re-initialize translator when language is changed in ACP

v1.18.x
psychobunny 11 years ago
parent c2a1cd94d0
commit 1caaa8c20a

@ -46,10 +46,18 @@ var fs = require('fs'),
set: function (field, value, callback) {
db.setObjectField('config', field, value, function(err, res) {
if (callback) {
if(!err && Meta.config)
if(!err && Meta.config) {
Meta.config[field] = value;
}
callback(err, res);
}
// this might be a good spot to add a hook
if (field === 'defaultLang') {
var translator = require('../public/src/translator');
translator.loadServer();
}
});
},
setOnEmpty: function (field, value, callback) {

Loading…
Cancel
Save