Bug 1405404: Add 'de' to list of pocket whitelisted locales. r=liuche
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 03 Oct 2017 10:29:49 -0700
changeset 384197 0db210721aa4cc46bd0566aa54406e8cd94b2bf2
parent 384196 fc879542e9ae103605e7c5063d82e84a10bf771f
child 384198 db40593b664cab0eed14a740a399f9c0fe54d803
push id52557
push usermichael.l.comella@gmail.com
push dateTue, 03 Oct 2017 18:22:27 +0000
treeherderautoland@0db210721aa4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs1405404
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamConfiguration.java
mobile/android/tests/background/junit4/src/org/mozilla/gecko/activitystream/homepanel/TestActivityStreamConfiguration.java
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamConfiguration.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamConfiguration.java
@@ -17,18 +17,26 @@ import java.util.Set;
 /**
  * Static functions for accessing user configuration information.
  *
  * TODO (bug 1405161): we should move all configuration accesses to this class to centralize them.
  */
 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",
             "en-GB",
             "en-US",
             "en-ZA",
     };
 
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/activitystream/homepanel/TestActivityStreamConfiguration.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/activitystream/homepanel/TestActivityStreamConfiguration.java
@@ -53,11 +53,15 @@ public class TestActivityStreamConfigura
 
     /**
      * Gets the {@link Locale} from the language tag, e.g. en-US. This duplicates
      * {@link org.mozilla.gecko.Locales#parseLocaleCode(String)} which is intentional since that is not the method we're
      * trying to test.
      */
     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]);
+        }
     }
 }
\ No newline at end of file