Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2515)

Unified Diff: app/l10n_util.cc

Issue 2809058: Add application locale policy. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: " Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/l10n_util.cc
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index e50bbb8f422cf8c21210807a1a9720b474cead4e..9da76fc25239df0b79e4900d444d6c9d69ab577a 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
« no previous file with comments | « no previous file | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698