We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5da6892 commit c2dcbfaCopy full SHA for c2dcbfa
src/lib/i18n.jsx
@@ -43,9 +43,10 @@ export function LanguageProvider({ children }) {
43
useEffect(() => {
44
const localStorageLang = localStorageGet('lang');
45
const navigatorLang = getNavigatorLanguage(config.languages);
46
+ const userLang = query.lang || localStorageLang || navigatorLang || 'en';
47
- setLang(query.lang || localStorageLang || navigatorLang || 'en');
48
- document.documentElement.lang = lang;
+ setLang(userLang);
49
+ document.documentElement.lang = userLang;
50
}, []);
51
52
const setAndUpdateHtmlAttr = (lang) => {
0 commit comments