Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
changeLanguage(language) {
this.setState({
generalData: {
...this.state.generalData,
currentLanguage: language,
},
});
i18n.init({
fallbackLng: language.split('-')[0],
lng: language,
});
}
const onChange = () => {
const { value } = event.target;
const language = getCurrentLanguage(value);
setCurrentLanguage(language);
i18n.init({
fallbackLng: language,
lng: language,
});
};
const onChange = () => {
const { value } = event.target;
const language = getCurrentLanguage(value);
setCurrentLanguage(language);
i18n.init({
fallbackLng: language,
lng: language,
});
};