diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 18:27:43 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 18:27:43 +0000 |
commit | 217bc8dd14a24d429dcad7a7b7bb0fa5e9d0404d (patch) | |
tree | e5be33bb7ca2265496492610dcd01af6e93c96e7 /app/l10n_util.cc | |
parent | 7a97d29f07bebe8cc2ba52ec9dbeded128a95c21 (diff) | |
download | chromium_src-217bc8dd14a24d429dcad7a7b7bb0fa5e9d0404d.zip chromium_src-217bc8dd14a24d429dcad7a7b7bb0fa5e9d0404d.tar.gz chromium_src-217bc8dd14a24d429dcad7a7b7bb0fa5e9d0404d.tar.bz2 |
Only check --lang and the app language pref on Windows. They
don't make sense on Linux/Mac so disable them.
I think we don't want to have a app language option on Linux
since the standard way to do this is to use LANG or LC_ALL.
Update the locale ui test to set LC_ALL on Linux.
BUG=15359
Review URL: http://codereview.chromium.org/155819
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util.cc')
-rw-r--r-- | app/l10n_util.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc index 4cda0506..751a41c 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -233,6 +233,11 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { PathService::Get(app::DIR_LOCALES, &locale_path); std::string resolved_locale; + // We only use --lang and the app pref on Windows. On Linux/Mac, we only + // look at the LC_*/LANG environment variables. We do, however, pass --lang + // to renderer and plugin processes so they know what language the parent + // process decided to use. +#if defined(OS_WIN) // First, check to see if there's a --lang flag. const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); const std::string& lang_arg = WideToASCII( @@ -248,6 +253,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { locale_path, &resolved_locale)) return resolved_locale; } +#endif // Next, try the system locale. const std::string system_locale = GetSystemLocale(); |