Node.js based forum software built for the modern web
fixed #912, added new page string for popular topics
Julian Lam031e8128c772
diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.jsonindex d01f5f8a9b..9fc75d3d2b 100644--- a/public/language/en_GB/pages.json+++ b/public/language/en_GB/pages.json@@ -1,6 +1,7 @@{"home": "Home","unread": "Unread Topics",+ "popular": "Popular Topics","recent": "Recent Topics","users": "Registered Users","notifications": "Notifications",diff --git a/src/webserver.js b/src/webserver.jsindex d87c58b66d..fd6536e5e4 100644--- a/src/webserver.js+++ b/src/webserver.js@@ -132,16 +132,6 @@ module.exports.server = server;href: nconf.get('relative_path') + '/favicon.ico'});- // Browser Title- var metaTitle = templateValues.metaTags.filter(function(tag) {- return tag.property === 'og:title';- });- if (metaTitle.length > 0 && metaTitle[0].content) {- templateValues.browserTitle = metaTitle[0].content;- } else {- templateValues.browserTitle = meta.config.browserTitle || 'NodeBB';- }-if(options.req.user && options.req.user.uid) {uid = options.req.user.uid;}@@ -153,15 +143,34 @@ module.exports.server = server;templateValues.customCSS = meta.config.customCSS;}- user.isAdministrator(uid, function(err, isAdmin) {- templateValues.isAdmin = isAdmin;+ async.parallel([+ function(next) {+ translator.get('pages:' + path.basename(options.req.url), function(translated) {+ var metaTitle = templateValues.metaTags.filter(function(tag) {+ return tag.name === 'title';+ });+ if (translated) {+ templateValues.browserTitle = translated;+ } else if (metaTitle.length > 0 && metaTitle[0].content) {+ templateValues.browserTitle = metaTitle[0].content;+ } else {+ templateValues.browserTitle = meta.config.browserTitle || 'NodeBB';+ }+ next();+ });+ },+ function(next) {+ user.isAdministrator(uid, function(err, isAdmin) {+ templateValues.isAdmin = isAdmin || false;+ next();+ });+ }+ ], function() {translator.translate(templates.header.parse(templateValues), function(template) {callback(null, template);});});--});};