Forgot to set lang attr on html

This commit is contained in:
Lim Chee Aun 2024-08-15 15:33:15 +08:00
parent acba051ca2
commit 1a3751ff16

View file

@ -17,6 +17,8 @@ i18n.load(DEFAULT_LANG, messages);
i18n.on('change', () => { i18n.on('change', () => {
const lang = i18n.locale; const lang = i18n.locale;
if (lang) { if (lang) {
// lang
document.documentElement.lang = lang;
// LTR or RTL // LTR or RTL
const { direction } = new Locale(lang).textInfo; const { direction } = new Locale(lang).textInfo;
document.documentElement.dir = direction; document.documentElement.dir = direction;