How to change default value react-i18next (in localstorage)

Viewed 2996

I`am use backend and language detector, but:

In localstorage is written I18nextLng with the value en-US, how to make default value is I18nextLng with the value En

init and other settings - default documentation

.init({
    fallbackLng: 'en',
    debug: true,
    interpolation: {
        escapeValue: false,
    },
})
1 Answers

I never used the language detector, but the way I set the default language is to set the lng key, and have resources obj

const resources = {
  en: { translation: {...} },
  fr: { translation: {...} }
}

.init({
    resources,
    lng: 'fr' // this is the default language. Try to put this
    fallbackLng: 'en',
    debug: true,
    interpolation: {
        escapeValue: false,
    },
})
Related