Bug 1405404: Add 'de' to list of pocket whitelisted locales. r=liuche

This is used in multi-locale builds, e.g. [1] where all German is "de" but in
[2], we have a separate l10n repo for en-GB.

[1]: https://hg.mozilla.org/releases/l10n/mozilla-beta/de
[2]: https://hg.mozilla.org/releases/l10n/mozilla-beta/en-GB

MozReview-Commit-ID: CXw9aFH9psz

--HG--
extra : rebase_source : 3f92c5f3cbefbb7cea14a1f673edce546a640a96
This commit is contained in:
Michael Comella 2017-10-03 10:29:49 -07:00
Родитель 31c3c16fec
Коммит f1209017b7
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -22,8 +22,16 @@ import java.util.Set;
public class ActivityStreamConfiguration {
private static final Set<Locale> pocketEnabledLocales;
/**
* Notes for testing: Firefox for Android can get its locale from two places: the system locale and an override for
* this locale specified in Fennec settings. As such, you should be sure to test all locale updates with both
* settings when possible. For example, Deutsch will be "de-DE" in the Android system but "de" when using the Fennec
* override.
*/
@VisibleForTesting static final String[] pocketEnabledLocaleTags = new String[] {
// Sorted alphabetically to preserve blame for additions/removals.
"de", // used by Firefox multi-locale builds.
"de-AT",
"de-CH",
"de-DE",

Просмотреть файл

@ -58,6 +58,10 @@ public class TestActivityStreamConfiguration {
*/
private Locale getLocaleFromLanguageTag(final String tag) {
final String[] split = tag.split("-");
return new Locale(split[0], split[1]);
if (split.length == 1) {
return new Locale(split[0]);
} else {
return new Locale(split[0], split[1]);
}
}
}