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