🩹(frontend) use browser language if no localStorage for detection

Previously, language detection was failing to read browser settings correctly.
Added explicit detection order to ensure localStorage preferences are checked
before falling back to browser language.
This commit is contained in:
lebaudantoine
2024-11-17 14:51:22 +01:00
committed by aleb_the_flash
parent 5c48ac100a
commit 24e819a533

View File

@@ -13,11 +13,14 @@ i18n
)
.use(initReactI18next)
.use(LanguageDetector)
i18n.init({
supportedLngs: ['en', 'fr'],
fallbackLng: 'en',
ns: i18nDefaultNamespace,
interpolation: {
escapeValue: false,
},
})
.init({
supportedLngs: ['en', 'fr'],
fallbackLng: 'fr',
ns: i18nDefaultNamespace,
detection: {
order: ['localStorage', 'navigator'],
},
interpolation: {
escapeValue: false,
},
})