From 7fbab5402a2e4a8463ae1d855fa614a0ec934a39 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 20 Aug 2015 15:56:47 -0400 Subject: [PATCH 1/2] closes #3381 --- src/widgets/index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/widgets/index.js b/src/widgets/index.js index 7a147f1dd6..fffc704e5f 100644 --- a/src/widgets/index.js +++ b/src/widgets/index.js @@ -5,6 +5,7 @@ var async = require('async'), templates = require('templates.js'), plugins = require('../plugins'), + translator = require('../../public/src/modules/translator'), db = require('../database'); var widgets = {}; @@ -29,7 +30,6 @@ widgets.render = function(uid, area, callback) { } async.map(widgetsByLocation[location], function(widget, next) { - if (!widget || !widget.data || (!!widget.data['hide-registered'] && uid !== 0) || (!!widget.data['hide-guests'] && uid === 0)) { return next(); } @@ -48,13 +48,17 @@ widgets.render = function(uid, area, callback) { } if (widget.data.container && widget.data.container.match('{body}')) { - html = templates.parse(widget.data.container, { - title: widget.data.title, - body: html + translator.translate(widget.data.title, function(title) { + html = templates.parse(widget.data.container, { + title: title, + body: html + }); + + next(null, {html: html}); }); + } else { + next(null, {html: html}); } - - next(null, {html: html}); }); }, function(err, result) { done(err, {location: location, widgets: result.filter(Boolean)}); From 67bf130e6a311d48a1da86260f4c5aa969ad4503 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 20 Aug 2015 15:59:21 -0400 Subject: [PATCH 2/2] up widget essentials --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23fa012afe..68bfb3af4c 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "nodebb-theme-lavender": "1.0.49", "nodebb-theme-persona": "2.0.15", "nodebb-theme-vanilla": "3.0.8", - "nodebb-widget-essentials": "1.0.4", + "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", "passport": "^0.2.1", "passport-local": "1.0.0",