소스 검색

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

Currently, when changing the app language, the `lang` attribute still in `en`.
José dBruxelles 4 년 전
부모
커밋
8a63187d4f
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/i18n.ts

+ 1 - 0
src/i18n.ts

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