# 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()
}
};
- window.t2 = function() {
+ window.t = function() {
if (!window.messages) {
return window.translate.apply(this, arguments);
}
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);