@@ -138,13 +138,17 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
138
138
void ShellMainDelegate::PreSandboxStartup () {
139
139
breakpad::SetBreakpadClient (g_chrome_breakpad_client.Pointer ());
140
140
CommandLine* command_line = CommandLine::ForCurrentProcess ();
141
+ std::string pref_locale;
142
+ if (command_line->HasSwitch (switches::kLang )) {
143
+ pref_locale = command_line->GetSwitchValueASCII (switches::kLang );
144
+ }
141
145
142
146
#if defined(OS_MACOSX)
143
147
OverrideFrameworkBundlePath ();
144
148
OverrideChildProcessPath ();
145
149
l10n_util::OverrideLocaleWithUserDefault ();
146
150
#endif // OS_MACOSX
147
- InitializeResourceBundle ();
151
+ InitializeResourceBundle (pref_locale );
148
152
149
153
std::string process_type =
150
154
command_line->GetSwitchValueASCII (switches::kProcessType );
@@ -179,13 +183,13 @@ int ShellMainDelegate::RunProcess(
179
183
return ShellBrowserMain (main_function_params);
180
184
}
181
185
182
- void ShellMainDelegate::InitializeResourceBundle () {
186
+ void ShellMainDelegate::InitializeResourceBundle (const std::string& pref_locale ) {
183
187
FilePath pak_file;
184
188
#if defined(OS_MACOSX)
185
189
FilePath locale_file;
186
190
if (!GetResourcesPakFilePath (pak_file))
187
191
LOG (FATAL) << " nw.pak file not found." ;
188
- std::string locale = l10n_util::GetApplicationLocale (std::string () );
192
+ std::string locale = l10n_util::GetApplicationLocale (pref_locale );
189
193
if (!GetLocalePakFilePath (locale, locale_file))
190
194
LOG (FATAL) << locale << " .pak file not found." ;
191
195
ui::ResourceBundle::InitSharedInstanceWithPakPath2 (pak_file, locale_file);
0 commit comments