ae11a9
diff -up firefox-51.0/toolkit/mozapps/extensions/internal/XPIProvider.jsm.1005640-accept-lang firefox-51.0/toolkit/mozapps/extensions/internal/XPIProvider.jsm
ae11a9
--- firefox-51.0/toolkit/mozapps/extensions/internal/XPIProvider.jsm.1005640-accept-lang	2017-01-16 17:16:52.000000000 +0100
ae11a9
+++ firefox-51.0/toolkit/mozapps/extensions/internal/XPIProvider.jsm	2017-01-18 12:35:29.380394216 +0100
ae11a9
@@ -2852,6 +2852,11 @@ this.XPIProvider = {
ae11a9
         this.addAddonsToCrashReporter();
ae11a9
       }
ae11a9
 
ae11a9
+      // Save locale settings to compare it later to check whenever some addon
ae11a9
+      // changed it.
ae11a9
+      var previousLocale = Cc["@mozilla.org/chrome/chrome-registry;1"]
ae11a9
+                          .getService(Ci.nsIXULChromeRegistry).getSelectedLocale("global");
ae11a9
+
ae11a9
       try {
ae11a9
         AddonManagerPrivate.recordTimestamp("XPI_bootstrap_addons_begin");
ae11a9
 
ae11a9
@@ -2880,6 +2885,14 @@ this.XPIProvider = {
ae11a9
         AddonManagerPrivate.recordException("XPI-BOOTSTRAP", "startup failed", e);
ae11a9
       }
ae11a9
 
ae11a9
+      var currentLocale = Cc["@mozilla.org/chrome/chrome-registry;1"]
ae11a9
+                         .getService(Ci.nsIXULChromeRegistry).getSelectedLocale("global");
ae11a9
+      if (currentLocale != previousLocale) {
ae11a9
+        // We have to flush string cache if the locale was changed during loading
ae11a9
+        // of addons
ae11a9
+        Services.obs.notifyObservers(null, "chrome-flush-caches", null);
ae11a9
+      }
ae11a9
+
ae11a9
       // Let these shutdown a little earlier when they still have access to most
ae11a9
       // of XPCOM
ae11a9
       Services.obs.addObserver({