]> source.dussan.org Git - sonarqube.git/commitdiff
do not break if navigator.language is undefined (#2263)
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 2 Aug 2017 09:51:06 +0000 (11:51 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Wed, 2 Aug 2017 09:51:06 +0000 (11:51 +0200)
server/sonar-web/src/main/js/helpers/l10n.js

index e4eb1f44d17be02df1dc62e512ec0ba339a66cab..706fad82906d0cbd224194eaac53671c59211cba 100644 (file)
@@ -79,12 +79,12 @@ export function requestMessages() {
 
   if (browserLocale) {
     params.locale = browserLocale;
-  }
 
-  if (browserLocale.startsWith(cachedLocale)) {
-    const bundleTimestamp = localStorage.getItem('l10n.timestamp');
-    if (bundleTimestamp !== null && checkCachedBundle()) {
-      params.ts = bundleTimestamp;
+    if (browserLocale.startsWith(cachedLocale)) {
+      const bundleTimestamp = localStorage.getItem('l10n.timestamp');
+      if (bundleTimestamp !== null && checkCachedBundle()) {
+        params.ts = bundleTimestamp;
+      }
     }
   }