Commit d95d2408 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

windows: call l10n_util::OverrideLocaleWithUILanguageList() earlier

As part of bug 800358 I moved loading ResourceBundle earlier
(specificaly to PreEarlyInitialization()). Unfortunately I missed that
OverrideLocaleWithUILanguageList() needs to be called before
this. This means the locales were not being picked up correctly for
Windows. This patch moves calling OverrideLocaleWithUILanguageList()
to before PreEarlyInitialization() so that locales are properly
loaded.

I tried adding a DCHECK that the locales are set before
GetLocaleOverrides() is called, but that appears to break things.

BUG=834372
TEST=see bug

Change-Id: Idb40ee30761034a6c67ac153da3f9cebc9f7de40
Reviewed-on: https://chromium-review.googlesource.com/1025070Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552935}
parent cddc0376
......@@ -576,6 +576,14 @@ int BrowserMainLoop::EarlyInitialization() {
#endif // defined(USE_GLIB)
if (parts_) {
#if defined(OS_WIN)
// If we're running tests (ui_task is non-null), then the ResourceBundle
// has already been initialized.
if (!parameters_.ui_task) {
// Override the configured locale with the user's preferred UI language.
l10n_util::OverrideLocaleWithUILanguageList();
}
#endif
const int pre_early_init_error_code = parts_->PreEarlyInitialization();
if (pre_early_init_error_code != content::RESULT_CODE_NORMAL_EXIT)
return pre_early_init_error_code;
......@@ -636,15 +644,6 @@ void BrowserMainLoop::PreMainMessageLoopStart() {
"BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart");
parts_->PreMainMessageLoopStart();
}
#if defined(OS_WIN)
// If we're running tests (ui_task is non-null), then the ResourceBundle
// has already been initialized.
if (!parameters_.ui_task) {
// Override the configured locale with the user's preferred UI language.
l10n_util::OverrideLocaleWithUILanguageList();
}
#endif
}
void BrowserMainLoop::MainMessageLoopStart() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment