mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
Standard language codes (#5218)
* Use standard language codes. Fallback for plugins. * Fix transifex config * Tab vs space here for some reason * Remove redundancies * config.relative_path instead of allcaps * added upgrade script for existing users' accounts
This commit is contained in:
committed by
Julian Lam
parent
cafbdfd83e
commit
c5237443cd
@@ -100,7 +100,7 @@ module.exports = function (middleware) {
|
||||
}
|
||||
|
||||
function translate(str, req, res, next) {
|
||||
var language = res.locals.config ? res.locals.config.userLang || 'en_GB' : 'en_GB';
|
||||
var language = res.locals.config && res.locals.config.userLang || 'en-GB';
|
||||
language = req.query.lang ? validator.escape(String(req.query.lang)) : language;
|
||||
translator.translate(str, language, function (translated) {
|
||||
next(null, translator.unescape(translated));
|
||||
|
||||
Reference in New Issue
Block a user