aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-07-02 12:24:20 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-07-02 12:24:43 +0200
commitd0f6b49b83178afdf8dfd4da48889354eaf99a23 (patch)
tree5e71b6d2fffa324a91ad7392eddb84cd69fcd0cc
parenta5bd64d75bb53ed17c549380c849cf5fd1bfb5b4 (diff)
downloadsonarqube-d0f6b49b83178afdf8dfd4da48889354eaf99a23.tar.gz
sonarqube-d0f6b49b83178afdf8dfd4da48889354eaf99a23.zip
SONAR-5334 Remove localStorage based translation methods
-rw-r--r--sonar-server/src/main/coffee/coding-rules/app.coffee2
-rw-r--r--sonar-server/src/main/js/translate.js20
2 files changed, 3 insertions, 19 deletions
diff --git a/sonar-server/src/main/coffee/coding-rules/app.coffee b/sonar-server/src/main/coffee/coding-rules/app.coffee
index 3c3ce98b880..a0ab8754246 100644
--- a/sonar-server/src/main/coffee/coding-rules/app.coffee
+++ b/sonar-server/src/main/coffee/coding-rules/app.coffee
@@ -481,7 +481,7 @@ requirejs [
# Message bundles
l10nXHR = window.requestMessages()
- jQuery.when(appXHR, l10nXHR).done ->
+ jQuery.when(l10nXHR, appXHR).done ->
# Remove the initial spinner
jQuery('#coding-rules-page-loader').remove()
diff --git a/sonar-server/src/main/js/translate.js b/sonar-server/src/main/js/translate.js
index 0681b727d46..b185c0c447c 100644
--- a/sonar-server/src/main/js/translate.js
+++ b/sonar-server/src/main/js/translate.js
@@ -5,7 +5,7 @@
}
};
- window.t2 = function() {
+ window.t = function() {
if (!window.messages) {
return window.translate.apply(this, arguments);
}
@@ -18,26 +18,10 @@
return (window.messages && window.messages[key]) || key;
};
- window.t = function() {
- var args = Array.prototype.slice.call(arguments, 0),
- key = args.join('.'),
- storageKey = 'l10n.' + key,
- message = localStorage.getItem(storageKey);
- if (!message) {
- return window.t2.apply(this, arguments);
- }
- return message;
- };
-
-
window.tp = function() {
var args = Array.prototype.slice.call(arguments, 0),
- key = args.shift(),
- storageKey = 'l10n.' + key,
- message = localStorage.getItem(storageKey);
- if (!message && window.messages) {
+ key = args.shift(),
message = window.messages[key];
- }
if (message) {
args.forEach(function(p, i) {
message = message.replace('{' + i + '}', p);