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

Unified Diff: chrome/browser/ui/webui/chromeos/login/l10n_util.h

Issue 483523005: Default to current UI locale when recommended locales are invalid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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: chrome/browser/ui/webui/chromeos/login/l10n_util.h
diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util.h b/chrome/browser/ui/webui/chromeos/login/l10n_util.h
index 4b42a73443336c45d5118f425f0053637681565a..d2c71beeac927781ed8113aaa5c1aa7cfea8f32f 100644
--- a/chrome/browser/ui/webui/chromeos/login/l10n_util.h
+++ b/chrome/browser/ui/webui/chromeos/login/l10n_util.h
@@ -37,6 +37,14 @@ scoped_ptr<base::ListValue> GetUILanguageList(
const std::vector<std::string>* most_relevant_language_codes,
const std::string& selected);
+// Returns the most first entry of |most_relevant_language_codes| that is
+// actually available (present in |available_locales|). If none of the entries
+// are present in |available_locales|, returns the |fallback_locale|.
+std::string FindMostRelevantLocale(
+ const std::vector<std::string>* most_relevant_language_codes,
+ const base::ListValue& available_locales,
+ const std::string& fallback_locale);
+
// Return a list of supported accept languages. The listed languages can be used
// in the Accept-Language header. The return value will look like:
// [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, ...]

Powered by Google App Engine
This is Rietveld 408576698