Commit d99af2de authored by Anthony Vallee-Dubois's avatar Anthony Vallee-Dubois Committed by Commit Bot

Only add the UI language to Fluent Language list

Bug: 958348
Change-Id: I3245764685899068e126025a1f164018cac9965d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602597Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658246}
parent 39686b0d
......@@ -99,11 +99,24 @@ base::Value LanguagePrefs::GetDefaultFluentLanguages() {
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
language::ToTranslateLanguageSynonym(&language);
languages.insert(std::move(language));
// crbug.com/958348: The default value for Accept-Language *should* be the
// same as the one for Fluent Languages. However, Accept-Language contains
// English (and more) in addition to the local language in most locales due
// to historical reasons. Exiting early from this loop is a temporary fix
// that allows Fluent Languages to be at least populated with the UI
// language while still allowing Translate to trigger on other languages,
// most importantly English.
// Once the change to remove English from Accept-Language defaults lands,
// this break should be removed to enable the Fluent Language List and the
// Accept-Language list to be initialized to the same values.
break;
}
#endif
base::Value language_values(base::Value::Type::LIST);
for (const std::string& language : languages)
language_values.GetList().emplace_back(language);
return language_values;
}
......
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