From d90de1c0fdaa6cb12b0d4a964ec7d9ff0a71e4d3 Mon Sep 17 00:00:00 2001 From: "markusheintz@chromium.org" Date: Mon, 19 Jul 2010 19:50:48 +0000 Subject: Adds the application locale police that allows to enforce the kApplicationLocale preference. bug=44504 test=none Review URL: http://codereview.chromium.org/2809058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52936 0039d316-1c4b-4281-b951-d872f2087c98 --- app/l10n_util.cc | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'app/l10n_util.cc') diff --git a/app/l10n_util.cc b/app/l10n_util.cc index e50bbb8..9da76fc 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -381,14 +381,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { // 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 = - parsed_command_line.GetSwitchValueASCII(switches::kLang); - if (!lang_arg.empty()) - candidates.push_back(lang_arg); - - // Second, try user prefs. + // First, try the preference value. if (!pref_locale.empty()) candidates.push_back(WideToASCII(pref_locale)); @@ -396,15 +389,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { candidates.push_back(system_locale); #elif defined(OS_CHROMEOS) - // We use --lang on chroemos for debugging/troubleshooting purpose. - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - const std::string& lang_arg = - parsed_command_line.GetSwitchValueASCII(switches::kLang); - if (!lang_arg.empty()) - candidates.push_back(lang_arg); - - // On ChromeOS, try user prefs. This restores the locale used by the - // previous run of the OS. + // On ChromeOS, use the application locale preference. if (!pref_locale.empty()) candidates.push_back(WideToASCII(pref_locale)); @@ -445,12 +430,11 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) { #else // !defined(OS_MACOSX) - // Use any override (Cocoa for the browser), otherwise use the command line - // argument. + // Use any override (Cocoa for the browser), otherwise use the preference + // passed to the function. std::string app_locale = l10n_util::GetLocaleOverride(); if (app_locale.empty()) { - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - app_locale = parsed_command_line.GetSwitchValueASCII(switches::kLang); + app_locale = WideToASCII(pref_locale); } // The above should handle all of the cases Chrome normally hits, but for some -- cgit v1.1