From 16ae0725e644e08832c8846a40c16662996be042 Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Sat, 6 Jul 2024 20:41:21 +0100 Subject: [PATCH] chore: took off the option of looking-up docsgpt-locale lang key in localStorage on first load --- frontend/src/locale/i18n.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/locale/i18n.ts b/frontend/src/locale/i18n.ts index 02c5593..dbf5ae1 100644 --- a/frontend/src/locale/i18n.ts +++ b/frontend/src/locale/i18n.ts @@ -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;