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