mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
This commit is contained in:
@@ -61,6 +61,7 @@ widgets.render = function (uid, options, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function renderWidget(widget, uid, options, callback) {
|
function renderWidget(widget, uid, options, callback) {
|
||||||
|
var userLang;
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
if (options.res.locals.isAPI) {
|
if (options.res.locals.isAPI) {
|
||||||
@@ -70,6 +71,7 @@ function renderWidget(widget, uid, options, callback) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (config, next) {
|
function (config, next) {
|
||||||
|
userLang = config.userLang;
|
||||||
var templateData = _.assign({ }, options.templateData, { config: config });
|
var templateData = _.assign({ }, options.templateData, { config: config });
|
||||||
plugins.fireHook('filter:widget.render:' + widget.widget, {
|
plugins.fireHook('filter:widget.render:' + widget.widget, {
|
||||||
uid: uid,
|
uid: uid,
|
||||||
@@ -101,7 +103,7 @@ function renderWidget(widget, uid, options, callback) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (html, next) {
|
function (html, next) {
|
||||||
translator.translate(html, function (translatedHtml) {
|
translator.translate(html, userLang, function (translatedHtml) {
|
||||||
next(null, { html: translatedHtml });
|
next(null, { html: translatedHtml });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user