diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/google_util.cc | 8 | ||||
-rw-r--r-- | chrome/browser/language_combobox_model.cc | 36 |
2 files changed, 16 insertions, 28 deletions
diff --git a/chrome/browser/google_util.cc b/chrome/browser/google_util.cc index 9cb5e22..e8553e9 100644 --- a/chrome/browser/google_util.cc +++ b/chrome/browser/google_util.cc @@ -35,8 +35,12 @@ const char kLinkDoctorBaseURL[] = "http://linkhelp.clients.google.com/tbproxy/lh/fixurl"; GURL AppendGoogleLocaleParam(const GURL& url) { - return AppendParam(url, "hl", - g_browser_process->GetApplicationLocale()); + // Google does not yet recognize 'nb' for Norwegian Bokmal, but it uses + // 'no' for that. + std::string locale = g_browser_process->GetApplicationLocale(); + if (locale == "nb") + locale = "no"; + return AppendParam(url, "hl", locale); } GURL AppendGoogleTLDParam(const GURL& url) { diff --git a/chrome/browser/language_combobox_model.cc b/chrome/browser/language_combobox_model.cc index 97efadd..6114573 100644 --- a/chrome/browser/language_combobox_model.cc +++ b/chrome/browser/language_combobox_model.cc @@ -38,32 +38,16 @@ void LanguageComboboxModel::InitNativeNames( std::string locale_code_str = locale_codes[i]; const char* locale_code = locale_codes[i].c_str(); - // Internally, we use the language code of zh-CN and zh-TW, but we want the - // display names to be Chinese (Simplified) and Chinese (Traditional). To - // do that, we use zh-hans and zh-hant when using ICU's - // uloc_getDisplayName. - if (locale_code_str == "zh-CN") { - locale_code = "zh-hans"; - } else if (locale_code_str == "zh-TW") { - locale_code = "zh-hant"; - } - - UErrorCode error = U_ZERO_ERROR; - const int buffer_size = 1024; - string16 name_local; - int actual_size = uloc_getDisplayName(locale_code, app_locale.c_str(), - WriteInto(&name_local, buffer_size + 1), buffer_size, &error); - DCHECK(U_SUCCESS(error)); - name_local.resize(actual_size); - - string16 name_native; - actual_size = uloc_getDisplayName(locale_code, locale_code, - WriteInto(&name_native, buffer_size + 1), buffer_size, &error); - DCHECK(U_SUCCESS(error)); - name_native.resize(actual_size); - - locale_names_.push_back(UTF16ToWideHack(name_local)); - native_names_[UTF16ToWideHack(name_local)] = LocaleData( + // TODO(jungshik): Even though these strings are used for the UI, + // the old code does not add an RTL mark for RTL locales. Make sure + // that it's ok without that. + string16 name_in_current_ui = + l10n_util::GetDisplayNameForLocale(locale_code, app_locale, false); + string16 name_native = + l10n_util::GetDisplayNameForLocale(locale_code, locale_code, false); + + locale_names_.push_back(UTF16ToWideHack(name_in_current_ui)); + native_names_[UTF16ToWideHack(name_in_current_ui)] = LocaleData( UTF16ToWideHack(name_native), locale_codes[i]); } |