constructor(props) { super(props); i18n.on('languageChanged', (lng) => { // needed when language changes via path and to change path when language does not change via path rootStoreInstance.configStore.language = lng; rootStoreInstance.configStore.changeHistory(this.props.history, this.props.location); }); }
// Update moment js locale when language is changed i18next.on("languageChanged", lng => { moment.locale(lng); });
i18next.on('languageChanged', function(countryCode = defaultCountryCode) { const splittedCountryCode = countryCode.split('-'); const lang = splittedCountryCode[0].toLowerCase();