Commit b1c6a6e8 authored by alemate's avatar alemate Committed by Commit bot

GetUILanguageList should correctly handle locale aliases.

GetUILanguageList didn't check for locale aliases when resolving input
method languages. This patch fixes it.

BUG=418220
TEST=manual

Review URL: https://codereview.chromium.org/608903003

Cr-Commit-Position: refs/heads/master@{#297086}
parent 442f3002
...@@ -167,7 +167,18 @@ scoped_ptr<base::ListValue> GetLanguageList( ...@@ -167,7 +167,18 @@ scoped_ptr<base::ListValue> GetLanguageList(
if (std::find(base_language_codes.begin(), if (std::find(base_language_codes.begin(),
base_language_codes.end(), base_language_codes.end(),
*it) == base_language_codes.end()) { *it) == base_language_codes.end()) {
continue; // Try to translate language code and look up again.
std::string resolved_locale;
if (!l10n_util::CheckAndResolveLocale(*it, &resolved_locale))
continue;
if (std::find(base_language_codes.begin(),
base_language_codes.end(),
resolved_locale) == base_language_codes.end()) {
continue;
}
// Translated language was successfully found.
} }
const base::string16 display_name = const base::string16 display_name =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment