mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
closes #3352
This commit is contained in:
@@ -125,7 +125,7 @@
|
|||||||
if (typeof language === 'function') {
|
if (typeof language === 'function') {
|
||||||
callback = language;
|
callback = language;
|
||||||
if ('undefined' !== typeof window && config) {
|
if ('undefined' !== typeof window && config) {
|
||||||
language = config.userLang || 'en_GB';
|
language = utils.params().lang || config.userLang || 'en_GB';
|
||||||
} else {
|
} else {
|
||||||
var meta = require('../../../src/meta');
|
var meta = require('../../../src/meta');
|
||||||
language = meta.config.defaultLang || 'en_GB';
|
language = meta.config.defaultLang || 'en_GB';
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ apiController.getConfig = function(req, res, next) {
|
|||||||
config.maximumFileSize = meta.config.maximumFileSize;
|
config.maximumFileSize = meta.config.maximumFileSize;
|
||||||
config['theme:id'] = meta.config['theme:id'];
|
config['theme:id'] = meta.config['theme:id'];
|
||||||
config.defaultLang = meta.config.defaultLang || 'en_GB';
|
config.defaultLang = meta.config.defaultLang || 'en_GB';
|
||||||
config.userLang = config.defaultLang;
|
config.userLang = req.query.lang || config.defaultLang;
|
||||||
config.environment = process.env.NODE_ENV;
|
config.environment = process.env.NODE_ENV;
|
||||||
config.loggedIn = !!req.user;
|
config.loggedIn = !!req.user;
|
||||||
config['cache-buster'] = meta.config['cache-buster'] || '';
|
config['cache-buster'] = meta.config['cache-buster'] || '';
|
||||||
@@ -89,7 +89,7 @@ apiController.getConfig = function(req, res, next) {
|
|||||||
config.topicsPerPage = settings.topicsPerPage;
|
config.topicsPerPage = settings.topicsPerPage;
|
||||||
config.postsPerPage = settings.postsPerPage;
|
config.postsPerPage = settings.postsPerPage;
|
||||||
config.notificationSounds = settings.notificationSounds;
|
config.notificationSounds = settings.notificationSounds;
|
||||||
config.userLang = settings.userLang || config.defaultLang;
|
config.userLang = req.query.lang || settings.userLang || config.defaultLang;
|
||||||
config.openOutgoingLinksInNewTab = settings.openOutgoingLinksInNewTab;
|
config.openOutgoingLinksInNewTab = settings.openOutgoingLinksInNewTab;
|
||||||
config.topicPostSort = settings.topicPostSort || config.topicPostSort;
|
config.topicPostSort = settings.topicPostSort || config.topicPostSort;
|
||||||
config.categoryTopicSort = settings.categoryTopicSort || config.categoryTopicSort;
|
config.categoryTopicSort = settings.categoryTopicSort || config.categoryTopicSort;
|
||||||
|
|||||||
@@ -347,6 +347,7 @@ middleware.processRender = function(req, res, next) {
|
|||||||
}
|
}
|
||||||
str = template + str;
|
str = template + str;
|
||||||
var language = res.locals.config ? res.locals.config.userLang || 'en_GB' : 'en_GB';
|
var language = res.locals.config ? res.locals.config.userLang || 'en_GB' : 'en_GB';
|
||||||
|
language = req.query.lang || language;
|
||||||
translator.translate(str, language, function(translated) {
|
translator.translate(str, language, function(translated) {
|
||||||
fn(err, translated);
|
fn(err, translated);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user