summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorcjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 18:26:09 +0000
committercjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 18:26:09 +0000
commit8fee1c35d91f2984c9a738008d5728e893ef91a5 (patch)
tree50cc2ac9e4416e27969e08298733c4d80cef68d4 /ui
parent4f40354683153162d6cb310aba339a7696f84e0f (diff)
downloadchromium_src-8fee1c35d91f2984c9a738008d5728e893ef91a5.zip
chromium_src-8fee1c35d91f2984c9a738008d5728e893ef91a5.tar.gz
chromium_src-8fee1c35d91f2984c9a738008d5728e893ef91a5.tar.bz2
Update handling of Android language codes
Chrome uses "id" as the Indonesian language code while Android uses the deprecated code "in". Similarly for Yiddish. This handles translating between the two. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10701179 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/l10n/l10n_util.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index 534bf1e..ff8733c 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -269,8 +269,8 @@ bool CheckAndResolveLocale(const std::string& locale,
// back to en-US in GetApplicationLocale so that it's a not critical,
// but we can do better.
std::string::size_type hyphen_pos = locale.find('-');
+ std::string lang(locale, 0, hyphen_pos);
if (hyphen_pos != std::string::npos && hyphen_pos > 0) {
- std::string lang(locale, 0, hyphen_pos);
std::string region(locale, hyphen_pos + 1);
std::string tmp_locale(lang);
// Map es-RR other than es-ES to es-419 (Chrome's Latin American
@@ -306,8 +306,8 @@ bool CheckAndResolveLocale(const std::string& locale,
}
}
- // Google updater uses no, iw and en for our nb, he, and en-US.
- // We need to map them to our codes.
+ // Google updater uses no, iw and en for our nb, he, and en-US, and
+ // Android uses iw-*, in-*, and ji-*. We need to map them to our codes.
struct {
const char* source;
const char* dest;
@@ -316,10 +316,12 @@ bool CheckAndResolveLocale(const std::string& locale,
{"tl", "fil"},
{"iw", "he"},
{"en", "en-US"},
+ {"in", "id"},
+ {"ji", "yi"},
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(alias_map); ++i) {
- if (LowerCaseEqualsASCII(locale, alias_map[i].source)) {
+ if (LowerCaseEqualsASCII(lang, alias_map[i].source)) {
std::string tmp_locale(alias_map[i].dest);
if (IsLocaleAvailable(tmp_locale)) {
resolved_locale->swap(tmp_locale);