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

Unified Diff: ui/base/l10n/l10n_util.cc

Issue 878723002: Upgrade ICU to 54.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add en-GB display name test Created 5 years, 10 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 | « build/secondary/third_party/icu/BUILD.gn ('k') | ui/base/l10n/l10n_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/l10n_util.cc
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index eb49b14cc9ce90e2896bbcb42ea30e01fe186650..80afb84df67db145e1c59d2a74c48318e0e7f1f4 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -191,7 +191,7 @@ bool IsDuplicateName(const std::string& locale_name) {
static const char* const kDuplicateNames[] = {
"en",
"en_001",
- "pt",
+ "pt", // pt-BR and pt-PT are used.
"zh",
"zh_hans_cn",
"zh_hant_hk",
@@ -200,11 +200,10 @@ bool IsDuplicateName(const std::string& locale_name) {
"zh_hant_tw"
};
- // Skip all 'es_RR'. Currently, we use 'es' for es-ES (Spanish in Spain).
- // 'es-419' (Spanish in Latin America) is not available in ICU so that it
- // has to be added manually in GetAvailableLocales().
- if (LowerCaseEqualsASCII(locale_name.substr(0, 3), "es_"))
- return true;
+ // Skip all the es_Foo other than es_419 for now.
+ if (StartsWithASCII(locale_name, "es_", false))
+ return !EndsWith(locale_name, "419", true);
+
for (size_t i = 0; i < arraysize(kDuplicateNames); ++i) {
if (base::strcasecmp(kDuplicateNames[i], locale_name.c_str()) == 0)
return true;
@@ -297,8 +296,6 @@ struct AvailableLocalesTraits
locales->push_back(locale_name);
}
- // Manually add 'es-419' to the list. See the comment in IsDuplicateName().
- locales->push_back("es-419");
return locales;
}
};
« no previous file with comments | « build/secondary/third_party/icu/BUILD.gn ('k') | ui/base/l10n/l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698