summaryrefslogtreecommitdiffstats
path: root/base/i18n
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-16 15:28:45 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-16 15:28:45 +0000
commit337ca0791390f606472d7530abf7603ad2f24ca8 (patch)
tree660625c6c058dab2acee91549ba258258bdc70f5 /base/i18n
parent40519596601f58e38c22b3ff9f2d8a47301e7c25 (diff)
downloadchromium_src-337ca0791390f606472d7530abf7603ad2f24ca8.zip
chromium_src-337ca0791390f606472d7530abf7603ad2f24ca8.tar.gz
chromium_src-337ca0791390f606472d7530abf7603ad2f24ca8.tar.bz2
The UI language rather than the locale is now used to pick Chrome's language on Windows. (Also fixed some unrelated lint errors.) With this change, l10n_util::GetApplicationLocale first checks for an override of the "configured locale" (in base::i18n) containing the list of preferred Windows UI languages. The browser triggers an override early in startup before the ApplicationLocale is determined. In effect, the browser no longer uses ICU on Windows for language detection. (This locale override mechanism is borrowed from the OS X port.)
Changes in Chrome Frame are largely a refactor, as some Win32 code in there has been moved into base/win. Also cleaned up language selection in installer_util so that the proper language is chosen for the EULA, installer messages, and shortcuts. In so doing, replaced hand-crafted lists of supported languages with either auto-generated lists (static consts) or logic so that the addition of translations in the future doesn't require code motion (that being said, there may be reason to update the alias and/or wildcard tables in language_selector.cc). In so doing, this change unlocks Amharic, Farsi, and Swahili translations for installer messages and shortcuts. BUG=39986,40496,26470 TEST=New MUI/Win32 calls are tested in base/win/i18n_unittest.cc. To test the overall functionality, uninstall Chrome, remove intl.app_locale user pref, switch to a supported display language (via the "Keyboards and Languages" tab of Win7's "Regional and Language" control panel, and install with { "distribution": { "require_eula": true } } in master_preferences (via -installerdata arg to setup.exe). If all goes well, both EULA and outer frame are in the same language as Windows. Also, from gwilson: "Install system-level Chrome in audit mode on a new machine, then go through the out-of-box-experience, select a language, and the in -product EULA (triggered by "require_eula" : true) and Chrome's UI should be in the language that the user selected." Review URL: http://codereview.chromium.org/4139010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/i18n')
-rw-r--r--base/i18n/rtl.cc16
-rw-r--r--base/i18n/rtl.h7
2 files changed, 2 insertions, 21 deletions
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc
index 9ff12d8..0881fb7 100644
--- a/base/i18n/rtl.cc
+++ b/base/i18n/rtl.cc
@@ -44,22 +44,6 @@ namespace i18n {
// Represents the locale-specific ICU text direction.
static TextDirection g_icu_text_direction = UNKNOWN_DIRECTION;
-#if defined(OS_WIN)
-void GetLanguageAndRegionFromOS(std::string* lang, std::string* region) {
- // Later we may have to change this to be OS-dependent so that
- // it's not affected by ICU's default locale. It's all right
- // to do this way because SetICUDefaultLocale is internal
- // to this file and we know that it's not yet called when this function
- // is called.
- const icu::Locale& locale = icu::Locale::getDefault();
- const char* language = locale.getLanguage();
- const char* country = locale.getCountry();
- DCHECK(language);
- *lang = language;
- *region = country;
-}
-#endif
-
// Convert the ICU default locale to a string.
std::string GetConfiguredLocale() {
return GetLocaleString(icu::Locale::getDefault());
diff --git a/base/i18n/rtl.h b/base/i18n/rtl.h
index 52b1a2b..ed0882f 100644
--- a/base/i18n/rtl.h
+++ b/base/i18n/rtl.h
@@ -6,6 +6,8 @@
#define BASE_I18N_RTL_H_
#pragma once
+#include <string>
+
#include "base/compiler_specific.h"
#include "base/string16.h"
#include "build/build_config.h"
@@ -29,11 +31,6 @@ enum TextDirection {
LEFT_TO_RIGHT,
};
-#if defined(OS_WIN)
-// Get language and region from the OS. Used by Chrome Frame.
-void GetLanguageAndRegionFromOS(std::string* lang, std::string* region);
-#endif
-
// Get the locale that the currently running process has been configured to use.
// The return value is of the form language[-country] (e.g., en-US) where the
// language is the 2 or 3 letter code from ISO-639.