]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5334 Fix l10n cache issue (304 passing as done)
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 4 Jul 2014 08:33:43 +0000 (10:33 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 4 Jul 2014 08:44:36 +0000 (10:44 +0200)
sonar-server/src/main/js/translate.js

index b185c0c447c8375db59ccf4c65b5365e785a44ab..207b93363e41d45ea65497c8cd35b0d3403a1cda 100644 (file)
@@ -81,7 +81,7 @@
           window.messages = JSON.parse(localStorage.getItem('l10n.bundle'));
         }
       }
-    }).done(function(bundle) {
+    }).done(function(bundle, textStatus, jqXHR) {
       if(bundle !== undefined) {
         bundleTimestamp = new Date().toISOString();
         bundleTimestamp = bundleTimestamp.substr(0, bundleTimestamp.indexOf('.')) + '+0000';
@@ -90,6 +90,8 @@
 
         window.messages = bundle;
         localStorage.setItem('l10n.bundle', JSON.stringify(bundle));
+      } else if (jqXHR.status == 304) {
+        window.messages = JSON.parse(localStorage.getItem('l10n.bundle'));
       }
     });
   };