]> source.dussan.org Git - sonarqube.git/commitdiff
fix SONAR-6041 properly use page locale
authorStas Vilchik <vilchiks@gmail.com>
Wed, 21 Jan 2015 09:00:43 +0000 (10:00 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 21 Jan 2015 09:02:17 +0000 (10:02 +0100)
server/sonar-web/src/main/js/translate.js

index 9daa77f88991b2178e3368bd02ce81bfd58cfff1..7123c87614107b02489114d827030c168ff5e11c 100644 (file)
 
 
   window.requestMessages = function() {
-    var currentLocale = (navigator.language || navigator.userLanguage).replace('-', '_');
-    var cachedLocale = localStorage.getItem('l10n.locale');
+    var currentLocale = window.pageLang,
+        cachedLocale = localStorage.getItem('l10n.locale');
     if (cachedLocale !== currentLocale) {
       localStorage.removeItem('l10n.timestamp');
     }
 
-    var bundleTimestamp = localStorage.getItem('l10n.timestamp');
-    var params = {};
+    var bundleTimestamp = localStorage.getItem('l10n.timestamp'),
+        params = { locale: currentLocale };
     if (bundleTimestamp !== null) {
       params.ts = bundleTimestamp;
     }