Update the lang attribute with the current lang. (#2995)

Currently, when changing the app language, the `lang` attribute still in `en`.
This commit is contained in:
José dBruxelles 2021-02-08 11:38:38 +01:00 committed by GitHub
parent 9c51ba6067
commit 8a63187d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,7 @@ let currentLangData = {};
export const setLanguage = async (lang: Language) => {
currentLang = lang;
document.documentElement.dir = currentLang.rtl ? "rtl" : "ltr";
document.documentElement.lang = currentLang.code;
currentLangData = await import(
/* webpackChunkName: "i18n-[request]" */ `./locales/${currentLang.code}.json`