Index: base/i18n/rtl.cc |
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc |
index d878c40da025b8845f2dc3d227efd27b5f64f789..f90efa32d951ba382ac05aa378a3785e209d5df8 100644 |
--- a/base/i18n/rtl.cc |
+++ b/base/i18n/rtl.cc |
@@ -16,30 +16,6 @@ |
namespace { |
-// 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"; |
- |
- if (country != NULL && *country != '\0') { |
- result += '-'; |
- result += country; |
- } |
- |
- if (variant != NULL && *variant != '\0') { |
- std::string variant_str(variant); |
- StringToLowerASCII(&variant_str); |
- result += '@' + variant_str; |
- } |
- |
- return result; |
-} |
- |
// Returns LEFT_TO_RIGHT or RIGHT_TO_LEFT if |character| has strong |
// directionality, returns UNKNOWN_DIRECTION if it doesn't. Please refer to |
// http://unicode.org/reports/tr9/ for more information. |
@@ -68,16 +44,33 @@ namespace i18n { |
// Represents the locale-specific ICU text direction. |
static TextDirection g_icu_text_direction = UNKNOWN_DIRECTION; |
+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"; |
+ |
+ if (country != NULL && *country != '\0') { |
+ result += '-'; |
+ result += country; |
+ } |
+ |
+ if (variant != NULL && *variant != '\0') { |
+ std::string variant_str(variant); |
+ StringToLowerASCII(&variant_str); |
+ result += '@' + variant_str; |
+ } |
+ |
+ return result; |
+} |
+ |
// Convert the ICU default locale to a string. |
std::string GetConfiguredLocale() { |
return GetLocaleString(icu::Locale::getDefault()); |
} |
-// Convert the ICU canonicalized locale to a string. |
-std::string GetCanonicalLocale(const char* locale) { |
- return GetLocaleString(icu::Locale::createCanonical(locale)); |
-} |
- |
// Convert Chrome locale name to ICU locale name |
std::string ICULocaleName(const std::string& locale_string) { |
// If not Spanish, just return it. |