aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/js/translate.js
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-05-23 16:28:01 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-05-23 16:54:25 +0200
commit62f4328dcc91dc9686e59a556acb993c159fefc9 (patch)
tree687b770891dce26a79f31fd3dceead3d9a0f0693 /sonar-server/src/main/js/translate.js
parentee35d07b1a86819991b5d44a1cc93b1334ba0215 (diff)
downloadsonarqube-62f4328dcc91dc9686e59a556acb993c159fefc9.tar.gz
sonarqube-62f4328dcc91dc9686e59a556acb993c159fefc9.zip
Fix "translate with parameters" function
Diffstat (limited to 'sonar-server/src/main/js/translate.js')
-rw-r--r--sonar-server/src/main/js/translate.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/sonar-server/src/main/js/translate.js b/sonar-server/src/main/js/translate.js
index 33e38b5f8a3..e9db1ba8764 100644
--- a/sonar-server/src/main/js/translate.js
+++ b/sonar-server/src/main/js/translate.js
@@ -33,7 +33,11 @@
window.tp = function() {
var args = Array.prototype.slice.call(arguments, 0),
key = args.shift(),
- message = window.messages[key];
+ storageKey = 'l10n.' + key,
+ message = localStorage.getItem(storageKey);
+ if (!message) {
+ message = window.messages[key];
+ }
if (message) {
args.forEach(function(p, i) {
message = message.replace('{' + i + '}', p);