summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 23:01:10 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 23:01:10 +0000
commit50501181e41c307f353432ba8aa176a366999611 (patch)
tree01f7d2ce058cb87b28c50f36c301d6017916b7a2 /chrome/browser/renderer_host
parent32e851ac4653283d8602cdf20ac1c689416389c8 (diff)
downloadchromium_src-50501181e41c307f353432ba8aa176a366999611.zip
chromium_src-50501181e41c307f353432ba8aa176a366999611.tar.gz
chromium_src-50501181e41c307f353432ba8aa176a366999611.tar.bz2
The browser would crash when pressing the translate button in the infobar when the locale is Norvegian,
Filipino or any Chrome languages that the translation server does not support. The crash would happen in the translate infobar, the source index would be -1 and would cause us to crash accessing that index in a vector. This CL fixes that by cleaning up the list of supported languages, so they match Chrome's locales. Also it makes sure we don't create an infobar if for any reason one of the language (source or target) is not supported. BUG=37218 TEST=For each language Chrome can be run into, select that language and open www.google.com. Check that the info-bar is shown for languages supported by the Google translate server (see the list at http://translate.google.com/) and for the supported language translating works. Review URL: http://codereview.chromium.org/661434 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/translation_service.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/translation_service.cc b/chrome/browser/renderer_host/translation_service.cc
index 3413d21..817fdf9 100644
--- a/chrome/browser/renderer_host/translation_service.cc
+++ b/chrome/browser/renderer_host/translation_service.cc
@@ -48,6 +48,17 @@ LocaleToCLDLanguage kLocaleToCLDLanguages[] = {
};
// The list of languages the Google translation server supports.
+// For information, here is the list of languages that Chrome can be run into
+// but that the translation server does not support:
+// am Amharic
+// bn Bengali
+// gu Gujarati
+// kn Kannada
+// ml Malayalam
+// mr Marathi
+// or Oriya
+// ta Tamil
+// te Telugu
const char* kSupportedLanguages[] = {
"af", // Afrikaans
"sq", // Albanian
@@ -63,8 +74,8 @@ const char* kSupportedLanguages[] = {
"nl", // Dutch
"en", // English
"et", // Estonian
- "tl", // Tagalog (Filipino)
"fi", // Finnish
+ "fil", // Filipino
"fr", // French
"gl", // Galician
"de", // German
@@ -83,7 +94,7 @@ const char* kSupportedLanguages[] = {
"mk", // Macedonian
"ms", // Malay
"mt", // Maltese
- "no", // Norwegian
+ "nb", // Norwegian
"fa", // Persian
"pl", // Polish
"pt", // Portuguese