Chromium Code Reviews| Index: ui/base/l10n/l10n_util.cc |
| diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc |
| index 3dbce9adf71c09495e0ba7dc075b34c47988b284..4ca5e6c0c367ce28f8a6a57c71644d785d4b20d1 100644 |
| --- a/ui/base/l10n/l10n_util.cc |
| +++ b/ui/base/l10n/l10n_util.cc |
| @@ -259,6 +259,14 @@ bool CheckAndResolveLocale(const std::string& locale, |
| *resolved_locale = locale; |
| return true; |
| } |
| + |
| + // If there's a variant, skip over it so we can try without the language |
| + // code. For example, ca_ES@valencia should cause us to try ca@valencia |
|
jungshik at Google
2011/05/31 09:23:52
nit: 'without the language code' => 'without the r
|
| + // before ca. |
| + std::string::size_type variant_pos = locale.find('@'); |
| + if (variant_pos != std::string::npos) |
| + return false; |
|
James Su
2011/05/30 02:00:49
If I understand correctly, this fix implies that t
|
| + |
| // If the locale matches language but not country, use that instead. |
| // TODO(jungshik) : Nothing is done about languages that Chrome |
| // does not support but available on Windows. We fall |
| @@ -275,12 +283,12 @@ bool CheckAndResolveLocale(const std::string& locale, |
| tmp_locale.append("-419"); |
| else if (LowerCaseEqualsASCII(lang, "zh")) { |
| // Map zh-HK and zh-MO to zh-TW. Otherwise, zh-FOO is mapped to zh-CN. |
| - if (LowerCaseEqualsASCII(region, "hk") || |
| - LowerCaseEqualsASCII(region, "mo")) { // Macao |
| - tmp_locale.append("-TW"); |
| - } else { |
| - tmp_locale.append("-CN"); |
| - } |
| + if (LowerCaseEqualsASCII(region, "hk") || |
| + LowerCaseEqualsASCII(region, "mo")) { // Macao |
| + tmp_locale.append("-TW"); |
| + } else { |
| + tmp_locale.append("-CN"); |
| + } |
| } |
| if (IsLocaleAvailable(tmp_locale, locale_path)) { |
| resolved_locale->swap(tmp_locale); |