Fix HTML `lang` attribute using the `defaultLang`

Themes need `lang="{function.localeToHTML, userLang, defaultLang}"` in
their header.tpl file
v1.18.x
Peter Jaszkowiak 8 years ago
parent 6432c02ab8
commit 64bf542d17

@ -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;

Loading…
Cancel
Save