Update app.js

migrated global *translate* to a *require.js* module.
v1.18.x
Manuel Valle 9 years ago
parent 89c21a438c
commit 41963bb300

@ -1,5 +1,5 @@
"use strict"; "use strict";
/*global templates, translator, ajaxify, utils, bootbox, overrides, socket, config, Visibility*/ /*global templates, ajaxify, utils, bootbox, overrides, socket, config, Visibility*/
var app = app || {}; var app = app || {};
@ -519,6 +519,7 @@ app.cacheBuster = null;
}; };
app.parseAndTranslate = function(template, blockName, data, callback) { app.parseAndTranslate = function(template, blockName, data, callback) {
require(['translator'], function(translator) {
if (typeof blockName === 'string') { if (typeof blockName === 'string') {
templates.parse(template, blockName, data, function(html) { templates.parse(template, blockName, data, function(html) {
translator.translate(html, function(translatedHTML) { translator.translate(html, function(translatedHTML) {
@ -533,5 +534,6 @@ app.cacheBuster = null;
}); });
}); });
} }
});
}; };
}()); }());

Loading…
Cancel
Save