diff options
author | jungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-05 20:06:22 +0000 |
---|---|---|
committer | jungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-05 20:06:22 +0000 |
commit | b4bd5fd4ac6901d67d1e1e64dbe63854608bf561 (patch) | |
tree | 60d993c18f1dfee2870f72c41a50845460716011 /chrome/common/l10n_util_unittest.cc | |
parent | 212d14930e66db247e71f72cd91c480c1f7c9374 (diff) | |
download | chromium_src-b4bd5fd4ac6901d67d1e1e64dbe63854608bf561.zip chromium_src-b4bd5fd4ac6901d67d1e1e64dbe63854608bf561.tar.gz chromium_src-b4bd5fd4ac6901d67d1e1e64dbe63854608bf561.tar.bz2 |
Dupe of http://codereview.chromium.org/238
The download page was quickly changed to address bug 1358202, but still there's
a problem that the UI
langauge of Chrome set-up program is different from what a user choose in the
following
scenarios:
* English is chosen on non-en-US OS
* Hebrew is chosen on non-Hebrew OS
* Norwegian Bokmal is selected on non-Norwegian Bokmal OS
Once these changes go in for next-point-release, the change made on the download
server can be reverted.
1. Aliases {iw,no,tl} to {he,nb,fil}.
2. Also map en to en-US.
3. Map {zh-HK, zh-MK, zh-SG} to {zh-TW, zh-TW, zh-CN}
This does not yet deal with other potentially problematic cases.
Added a similar change for l10n_string_util.cc for installer .
Tony already LGTM'd 238 so that I'm tbr'ing here.
BUG=1358202
TEST=L10n* unittest
TBR=tc
Review URL: http://codereview.chromium.org/260
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/l10n_util_unittest.cc')
-rw-r--r-- | chrome/common/l10n_util_unittest.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/common/l10n_util_unittest.cc b/chrome/common/l10n_util_unittest.cc index 9b09037..ee14f23 100644 --- a/chrome/common/l10n_util_unittest.cc +++ b/chrome/common/l10n_util_unittest.cc @@ -77,6 +77,11 @@ TEST(L10nUtilTest, GetAppLocale) { L"fr.dll", L"es-419.dll", L"es.dll", + L"zh-TW.dll", + L"zh-CN.dll", + L"he.dll", + L"fil.dll", + L"nb.dll", }; for (size_t i = 0; i < arraysize(filenames); ++i) { std::wstring filename = new_locale_dir; @@ -102,6 +107,12 @@ TEST(L10nUtilTest, GetAppLocale) { SetICUDefaultLocale(L"en-US"); EXPECT_EQ(L"fr", l10n_util::GetApplicationLocale(L"fr")); EXPECT_EQ(L"fr", l10n_util::GetApplicationLocale(L"fr-CA")); + + SetICUDefaultLocale(L"en-US"); + // Aliases iw, no, tl to he, nb, fil. + EXPECT_EQ(L"he", l10n_util::GetApplicationLocale(L"iw")); + EXPECT_EQ(L"nb", l10n_util::GetApplicationLocale(L"no")); + EXPECT_EQ(L"fil", l10n_util::GetApplicationLocale(L"tl")); // es-419 and es-XX (where XX is not Spain) should be // mapped to es-419 (Latin American Spanish). EXPECT_EQ(L"es-419", l10n_util::GetApplicationLocale(L"es-419")); @@ -121,6 +132,19 @@ TEST(L10nUtilTest, GetAppLocale) { SetICUDefaultLocale(L"es"); EXPECT_EQ(L"es", l10n_util::GetApplicationLocale(L"")); + SetICUDefaultLocale(L"zh-HK"); + EXPECT_EQ(L"zh-TW", l10n_util::GetApplicationLocale(L"")); + EXPECT_EQ(L"zh-CN", l10n_util::GetApplicationLocale(L"zh-CN")); + + SetICUDefaultLocale(L"zh-MK"); + EXPECT_EQ(L"zh-TW", l10n_util::GetApplicationLocale(L"")); + + SetICUDefaultLocale(L"zh-SG"); + EXPECT_EQ(L"zh-CN", l10n_util::GetApplicationLocale(L"")); + + SetICUDefaultLocale(L"he"); + EXPECT_EQ(L"en-US", l10n_util::GetApplicationLocale(L"en")); + // Clean up. PathService::Override(chrome::DIR_LOCALES, orig_locale_dir); file_util::Delete(new_locale_dir, true); |