From: Stas Vilchik Date: Wed, 21 Jan 2015 09:00:43 +0000 (+0100) Subject: fix SONAR-6041 properly use page locale X-Git-Tag: latest-silver-master-#65~161 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f83345e5344f08e74f7b7a812e6ba14a4dcdc283;p=sonarqube.git fix SONAR-6041 properly use page locale --- diff --git a/server/sonar-web/src/main/js/translate.js b/server/sonar-web/src/main/js/translate.js index 9daa77f8899..7123c876141 100644 --- a/server/sonar-web/src/main/js/translate.js +++ b/server/sonar-web/src/main/js/translate.js @@ -62,14 +62,14 @@ 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; }