I currently have this configuration in index.jsx:
i18n.use(LanguageDetector).init({
detection: {
caches: ['cookie'],
cookieOptions: { sameSite: 'none' },
},
});
i18n.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources: {
en: translation_en,
fr: translation_fr,
},
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
});
And it does not store anything in cookies. If I replace the caches by localStorage, it works (in localStorage, not cookies, obviously).
This is the current configuration, but fyi, my initial one was this :
const BACKEND_DOMAIN = process.env.REACT_APP_BACKEND_DOMAIN;
i18n.use(LanguageDetector).init({
detection: {
cookieDomain: BACKEND_DOMAIN,
caches: ['localStorage', 'cookie'],
cookieOptions: { sameSite: 'none' },
},
});
As I want the cookie to be sent to the backend api, so I can use the locale there.
I have no lead whatsoever, anyone got an idea?