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

Unified Diff: base/i18n/rtl.cc

Issue 834183005: Move two locale functions from rtl.h into l10n_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: base/i18n/rtl.cc
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc
index 392cb13bdb78c112be17c8ee2c17ee69faf2d0fb..3eaba8dff6d06f00bfdd723e7e2270116525ca37 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);
- base::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,6 @@ namespace i18n {
// Represents the locale-specific ICU text direction.
static TextDirection g_icu_text_direction = UNKNOWN_DIRECTION;
-// 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.

Powered by Google App Engine
This is Rietveld 408576698