mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
re-initialize translator when language is changed in ACP
This commit is contained in:
10
src/meta.js
10
src/meta.js
@@ -46,10 +46,18 @@ var fs = require('fs'),
|
|||||||
set: function (field, value, callback) {
|
set: function (field, value, callback) {
|
||||||
db.setObjectField('config', field, value, function(err, res) {
|
db.setObjectField('config', field, value, function(err, res) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
if(!err && Meta.config)
|
if(!err && Meta.config) {
|
||||||
Meta.config[field] = value;
|
Meta.config[field] = value;
|
||||||
|
}
|
||||||
|
|
||||||
callback(err, res);
|
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) {
|
setOnEmpty: function (field, value, callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user