Skip to content

Node.js based forum software built for the modern web

closes https://github.com/NodeBB/nodebb-widget-essentials/issues/38

Barış Soner Uşaklı917cbc927390
diff --git a/src/widgets/index.js b/src/widgets/index.js
index 1d60664247..7a77c34148 100644
--- a/src/widgets/index.js
+++ b/src/widgets/index.js
@@ -61,6 +61,7 @@ widgets.render = function (uid, options, callback) {
};
function renderWidget(widget, uid, options, callback) {
+ var userLang;
async.waterfall([
function (next) {
if (options.res.locals.isAPI) {
@@ -70,6 +71,7 @@ function renderWidget(widget, uid, options, callback) {
}
},
function (config, next) {
+ userLang = config.userLang;
var templateData = _.assign({ }, options.templateData, { config: config });
plugins.fireHook('filter:widget.render:' + widget.widget, {
uid: uid,
@@ -101,7 +103,7 @@ function renderWidget(widget, uid, options, callback) {
}
},
function (html, next) {
- translator.translate(html, function (translatedHtml) {
+ translator.translate(html, userLang, function (translatedHtml) {
next(null, { html: translatedHtml });
});
},