I would like for i18next to wait for the redux store to be ready. I'm storing the user's chosen language in the store, using persistor from redux-persist to rehydrate it at app startup. I tried to set the language from the store :
// ...
import store from '../redux';
// ...
const lng = store.getState().user.language
? store.getState().user.language
: Localization.locale.slice(0, 2);
i18next
// .use(languageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
debug: true,
resources,
lng,
});
But at this point the store is still in its initialState and not rehydrated yet. Is there a way I could do this?