mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-20 19:11:23 +02:00
Fix HTML lang attribute using the defaultLang
Themes need `lang="{function.localeToHTML, userLang, defaultLang}"` in
their header.tpl file
This commit is contained in:
@@ -176,7 +176,8 @@
|
||||
}).join('');
|
||||
};
|
||||
|
||||
helpers.localeToHTML = function (locale) {
|
||||
helpers.localeToHTML = function (locale, fallback) {
|
||||
locale = locale || fallback || 'en-GB';
|
||||
return locale.replace('_', '-');
|
||||
};
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ module.exports = function (middleware) {
|
||||
templateValues.customJS = templateValues.useCustomJS ? meta.config.customJS : '';
|
||||
templateValues.maintenanceHeader = parseInt(meta.config.maintenanceMode, 10) === 1 && !results.isAdmin;
|
||||
templateValues.defaultLang = meta.config.defaultLang || 'en-GB';
|
||||
templateValues.userLang = res.locals.config.userLang;
|
||||
templateValues.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;
|
||||
templateValues.privateTagListing = parseInt(meta.config.privateTagListing, 10) === 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user