Load new message catalogs using jquery.i18n

This commit is contained in:
Remi Rampin 2017-10-23 15:39:46 -04:00 committed by Antonin Delpeuch
parent ebbafd5977
commit 2356656b50
4 changed files with 13 additions and 7 deletions

View File

@ -69,7 +69,10 @@ public class LoadLanguageCommand extends Command {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setContentType("application/json"); response.setContentType("application/json");
try { try {
json.write(response.getWriter()); JSONObject fullJson = new JSONObject();
fullJson.put("dictionary", json);
fullJson.put("lang", lang);
fullJson.write(response.getWriter());
} catch (JSONException e) { } catch (JSONException e) {
logger.error("Error writing language labels to response stream"); logger.error("Error writing language labels to response stream");
} }

View File

@ -48,10 +48,11 @@ $.ajax({
// lang : lang // lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data['dictionary'];
lang = data['lang'];
} }
}); });
$.i18n.setDictionary(dictionary); $.i18n().load(dictionary, lang);
// End internationalization // End internationalization
Refine.selectActionArea = function(id) { Refine.selectActionArea = function(id) {

View File

@ -44,10 +44,11 @@ module : "core",
//lang : lang //lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data['dictionary'];
lang = data['lang'];
} }
}); });
$.i18n.setDictionary(dictionary); $.i18n().load(dictionary, lang);
//End internationalization //End internationalization
function deDupUserMetaData(arrObj) { function deDupUserMetaData(arrObj) {

View File

@ -45,10 +45,11 @@ $.ajax({
// lang : lang // lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data['dictionary'];
lang = data['lang'];
} }
}); });
$.i18n.setDictionary(dictionary); $.i18n().load(dictionary, lang);
// End internationalization // End internationalization
var Refine = { var Refine = {