Backed out changeset 3bd7e87109e0 (bug 1410733)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 24 Oct 2017 18:57:34 +0200
changeset 685770 6b17da389d8d573efa3c634f59e5861ede1e9039
parent 685769 679aed94d97ba18bbabc15fa57a193f7225ed502
child 685771 1814b6aba6e3e8711ebbe974dfebe31e6cb27a40
push id86016
push userkgupta@mozilla.com
push dateWed, 25 Oct 2017 01:53:44 +0000
bugs1410733
milestone58.0a1
backs out3bd7e87109e088404d8249a128d9cbcc7587ad1d
Backed out changeset 3bd7e87109e0 (bug 1410733)
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/nsBlocklistService.js
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -4833,19 +4833,19 @@ AddonInternal.prototype = {
      *
      * First, we reduce this nested structure to a flat list of locale codes.
      */
     const locales = [].concat(...this.locales.map(loc => loc.locales));
 
     let requestedLocales = Services.locale.getRequestedLocales();
 
     /**
-     * If en-US is not in the list, add it as the last fallback.
+     * If en is not the top locale, add "en-US" to the list.
      */
-    if (!requestedLocales.includes("en-US")) {
+    if (!requestedLocales[0].startsWith("en")) {
       requestedLocales.push("en-US");
     }
 
     /**
      * Then we negotiate best locale code matching the app locales.
      */
     let bestLocale = Services.locale.negotiateLanguages(
       requestedLocales,
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -236,17 +236,17 @@ function matchesOSABI(blocklistElement) 
 }
 
 /**
  * Gets the current value of the locale.  It's possible for this preference to
  * be localized, so we have to do a little extra work here.  Similar code
  * exists in nsHttpHandler.cpp when building the UA string.
  */
 function getLocale() {
-  return Services.locale.getRequestedLocale();
+  return Services.locale.getRequestedLocales();
 }
 
 /* Get the distribution pref values, from defaults only */
 function getDistributionPrefValue(aPrefName) {
   return gPref.getDefaultBranch(null).getCharPref(aPrefName, "default");
 }
 
 /**