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

Unified Diff: base/i18n/rtl.cc

Issue 7086017: Fix the loading of ca@valencia.pak, which is available in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 9 years, 6 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 | « no previous file | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/rtl.cc
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc
index 2712a44aa3f2335d2ac5190692b4c86dabc86367..9684b1d94c586c340254296f3bc49b9358b6174f 100644
--- a/base/i18n/rtl.cc
+++ b/base/i18n/rtl.cc
@@ -20,10 +20,12 @@
namespace {
-// Extract language and country, ignore keywords, concatenate using dash.
+// Extract language, country and variant, but ignore keywords. For example,
+// en-US, ca@valencia, ca-ES@valencia.
std::string GetLocaleString(const icu::Locale& locale) {
const char* language = locale.getLanguage();
const char* country = locale.getCountry();
+ const char* variant = locale.getVariant();
std::string result =
(language != NULL && *language != '\0') ? language : "und";
@@ -33,6 +35,12 @@ std::string GetLocaleString(const icu::Locale& locale) {
result += country;
}
+ if (variant != NULL && *variant != '\0') {
+ std::string variant_str(variant);
+ StringToLowerASCII(&variant_str);
+ result += '@' + variant_str;
+ }
+
return result;
}
« no previous file with comments | « no previous file | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698