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