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

Issue 4139010: The UI language rather than the locale is now used to pick Chrome's language ... (Closed)

Created:
10 years, 1 month ago by grt (UTC plus 2)
Modified:
9 years, 7 months ago
CC:
chromium-reviews, amit, Paweł Hajdan Jr., brettw-cc_chromium.org, Glenn Wilson, cpu_(ooo_6.6-7.5)
Visibility:
Public.

Description

The UI language rather than the locale is now used to pick Chrome's language on Windows. (Also fixed some unrelated lint errors.) With this change, l10n_util::GetApplicationLocale first checks for an override of the "configured locale" (in base::i18n) containing the list of preferred Windows UI languages. The browser triggers an override early in startup before the ApplicationLocale is determined. In effect, the browser no longer uses ICU on Windows for language detection. (This locale override mechanism is borrowed from the OS X port.) Changes in Chrome Frame are largely a refactor, as some Win32 code in there has been moved into base/win. Also cleaned up language selection in installer_util so that the proper language is chosen for the EULA, installer messages, and shortcuts. In so doing, replaced hand-crafted lists of supported languages with either auto-generated lists (static consts) or logic so that the addition of translations in the future doesn't require code motion (that being said, there may be reason to update the alias and/or wildcard tables in language_selector.cc). In so doing, this change unlocks Amharic, Farsi, and Swahili translations for installer messages and shortcuts. BUG=39986, 40496, 26470 TEST=New MUI/Win32 calls are tested in base/win/i18n_unittest.cc. To test the overall functionality, uninstall Chrome, remove intl.app_locale user pref, switch to a supported display language (via the "Keyboards and Languages" tab of Win7's "Regional and Language" control panel, and install with { "distribution": { "require_eula": true } } in master_preferences (via -installerdata arg to setup.exe). If all goes well, both EULA and outer frame are in the same language as Windows. Also, from gwilson: "Install system-level Chrome in audit mode on a new machine, then go through the out-of-box-experience, select a language, and the in -product EULA (triggered by "require_eula" : true) and Chrome's UI should be in the language that the user selected." Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66275

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 16

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 18

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+879 lines, -366 lines) Patch
M app/l10n_util.cc View 4 5 6 7 8 9 10 11 4 chunks +18 lines, -2 lines 0 comments Download
M app/l10n_util_win.h View 4 5 6 7 8 9 10 11 2 chunks +11 lines, -0 lines 0 comments Download
M app/l10n_util_win.cc View 4 5 6 7 8 9 10 11 3 chunks +38 lines, -3 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M base/i18n/rtl.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -5 lines 0 comments Download
M base/i18n/rtl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -16 lines 0 comments Download
A base/win/i18n.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +32 lines, -0 lines 0 comments Download
A base/win/i18n.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +169 lines, -0 lines 0 comments Download
A base/win/i18n_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +42 lines, -0 lines 0 comments Download
M chrome/browser/browser_main_win.cc View 3 4 5 6 7 8 9 10 11 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/chrome_installer.gypi View 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_installer_util.gypi View 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/installer/util/l10n_string_util.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -210 lines 0 comments Download
A chrome/installer/util/language_selector.h View 6 7 8 9 10 11 12 13 1 chunk +60 lines, -0 lines 0 comments Download
A chrome/installer/util/language_selector.cc View 6 7 8 9 10 11 12 13 1 chunk +301 lines, -0 lines 0 comments Download
A chrome/installer/util/language_selector_unittest.cc View 6 7 8 9 10 11 12 13 1 chunk +128 lines, -0 lines 0 comments Download
M chrome/installer/util/prebuild/create_string_rc.py View 6 7 8 9 10 11 3 chunks +13 lines, -7 lines 0 comments Download
M chrome_frame/simple_resource_loader.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -10 lines 0 comments Download
M chrome_frame/simple_resource_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +34 lines, -90 lines 0 comments Download
M chrome_frame/test/simple_resource_loader_test.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -23 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
grt (UTC plus 2)
This change changes language detection on Windows in both Chrome and in setup.exe to use ...
10 years, 1 month ago (2010-11-01 17:25:19 UTC) #1
grt (UTC plus 2)
Please hold off on the review as the change broke L10nUtilTest.GetAppLocale. I'm working on a ...
10 years, 1 month ago (2010-11-01 19:49:53 UTC) #2
grt (UTC plus 2)
I've updated the change and description. It now passes the win trybot and is ready ...
10 years, 1 month ago (2010-11-02 18:17:15 UTC) #3
jungshik at Google
Thank you for the CL ! Some comments below. http://codereview.chromium.org/4139010/diff/33002/46001 File app/l10n_util.cc (right): http://codereview.chromium.org/4139010/diff/33002/46001#newcode375 app/l10n_util.cc:375: ...
10 years, 1 month ago (2010-11-02 20:33:53 UTC) #4
robertshield
LGTM, don't have much to add beyond Jungshik's comments. http://codereview.chromium.org/4139010/diff/33002/46008 File base/win/i18n.cc (right): http://codereview.chromium.org/4139010/diff/33002/46008#newcode41 base/win/i18n.cc:41: ...
10 years, 1 month ago (2010-11-04 13:56:49 UTC) #5
grt (UTC plus 2)
Thanks for the comments, Jungshik and Robert. I've updated the CL to incorporate all previous ...
10 years, 1 month ago (2010-11-08 04:38:55 UTC) #6
grt (UTC plus 2)
This change has finally passed a win trybot (http://build.chromium.org/p/tryserver.chromium/builders/win/builds/1868) and is ready for re-review.
10 years, 1 month ago (2010-11-09 18:10:48 UTC) #7
robertshield
LFTM (Looks Fantastic To Me). Nought but very minor nits below. http://codereview.chromium.org/4139010/diff/125001/chrome/installer/util/language_selector_unittest.cc File chrome/installer/util/language_selector_unittest.cc (right): ...
10 years, 1 month ago (2010-11-11 14:42:17 UTC) #8
grt (UTC plus 2)
Thanks, Robert. Please see my comments to your comments. http://codereview.chromium.org/4139010/diff/125001/chrome/installer/util/language_selector_unittest.cc File chrome/installer/util/language_selector_unittest.cc (right): http://codereview.chromium.org/4139010/diff/125001/chrome/installer/util/language_selector_unittest.cc#newcode33 chrome/installer/util/language_selector_unittest.cc:33: ...
10 years, 1 month ago (2010-11-11 15:23:56 UTC) #9
robertshield
http://codereview.chromium.org/4139010/diff/125001/chrome/installer/util/language_selector_unittest.cc File chrome/installer/util/language_selector_unittest.cc (right): http://codereview.chromium.org/4139010/diff/125001/chrome/installer/util/language_selector_unittest.cc#newcode33 chrome/installer/util/language_selector_unittest.cc:33: #endif // !defined(GOOGLE_CHROME_BUILD) On 2010/11/11 15:23:57, grt wrote: > ...
10 years, 1 month ago (2010-11-11 16:18:53 UTC) #10
grt (UTC plus 2)
Thanks for the schoolin'. I've changed all strings for the header file to be ASCII ...
10 years, 1 month ago (2010-11-11 16:29:26 UTC) #11
jungshik at Google
Thank you for all the changes. Very nice ! And sorry for the delay. They ...
10 years, 1 month ago (2010-11-11 20:30:45 UTC) #12
grt (UTC plus 2)
Thanks for the review. Regarding Amharic and the other languages that had been left out ...
10 years, 1 month ago (2010-11-12 04:22:02 UTC) #13
jungshik at Google
10 years, 1 month ago (2010-11-15 23:26:12 UTC) #14
Great ! Thank you for addressing my comments. 

As for pt -> pt-BR, I've had a small cl in my local tree (for l10n_util for
chrome), but haven't checked in. Anyway, I think it's good to have that in the
installer. 

You can land now with that changed.

Thanks again for this nice CL !

Powered by Google App Engine
This is Rietveld 408576698