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

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

Issue 846373002: Move l10n_util's GetCanonicalLocal() function into base/i18n module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromeos 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
« no previous file with comments | « ui/base/l10n/l10n_util.h ('k') | no next file » | 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 7515f3f6071663a878863e231022303f0f210e35..eb49b14cc9ce90e2896bbcb42ea30e01fe186650 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -310,10 +310,6 @@ base::LazyInstance<std::vector<std::string>, AvailableLocalesTraits>
namespace l10n_util {
-std::string GetCanonicalLocale(const std::string& locale) {
- return base::i18n::GetCanonicalLocale(locale.c_str());
-}
-
std::string GetLanguage(const std::string& locale) {
const std::string::size_type hyphen_pos = locale.find('-');
return std::string(locale, 0, hyphen_pos);
@@ -434,14 +430,15 @@ std::string GetApplicationLocaleInternal(const std::string& pref_locale) {
// First, try the preference value.
if (!pref_locale.empty())
- candidates.push_back(GetCanonicalLocale(pref_locale));
+ candidates.push_back(base::i18n::GetCanonicalLocale(pref_locale));
// Next, try the overridden locale.
const std::vector<std::string>& languages = l10n_util::GetLocaleOverrides();
if (!languages.empty()) {
candidates.reserve(candidates.size() + languages.size());
std::transform(languages.begin(), languages.end(),
- std::back_inserter(candidates), &GetCanonicalLocale);
+ std::back_inserter(candidates),
+ &base::i18n::GetCanonicalLocale);
} else {
// If no override was set, defer to ICU
candidates.push_back(base::i18n::GetConfiguredLocale());
« no previous file with comments | « ui/base/l10n/l10n_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698