chore: took off the option of looking-up docsgpt-locale lang key in localStorage on first load

This commit is contained in:
utin-francis-peter
2024-07-06 20:41:21 +01:00
parent 6f41759519
commit 16ae0725e6

View File

@@ -27,13 +27,12 @@ i18n
},
fallbackLng: 'en',
detection: {
order: ['localStorage', 'navigator'], // checks localStorage for existing lang before browser's
caches: ['localStorage'], //stores detected lang to localStorage with i18nextLng key
lookupLocalStorage: 'docsgpt-locale', //using docsgpt-locale as the custom key for storing and retrieving the lang rather than the default `i18nextLng`
order: ['localStorage', 'navigator'],
caches: ['localStorage'],
lookupLocalStorage: 'docsgpt-locale',
},
});
const savedLocale = localStorage.getItem('docsgpt-locale') ?? i18n.language;
i18n.changeLanguage(savedLocale);
i18n.changeLanguage(i18n.language);
export default i18n;