diff --git a/frontend/src/components/application-loader/initializers/setupI18n.ts b/frontend/src/components/application-loader/initializers/setupI18n.ts index 427c1996c..0d8892315 100644 --- a/frontend/src/components/application-loader/initializers/setupI18n.ts +++ b/frontend/src/components/application-loader/initializers/setupI18n.ts @@ -36,5 +36,6 @@ export const setUpI18n = async (): Promise => { } }) + i18n.on('languageChanged', (language) => (Settings.defaultLocale = language)) Settings.defaultLocale = i18n.language } diff --git a/frontend/src/components/layout/settings-dialog/global/language-picker.tsx b/frontend/src/components/layout/settings-dialog/global/language-picker.tsx index fae07707a..264d60295 100644 --- a/frontend/src/components/layout/settings-dialog/global/language-picker.tsx +++ b/frontend/src/components/layout/settings-dialog/global/language-picker.tsx @@ -65,9 +65,9 @@ export const LanguagePicker: React.FC = () => { const onChangeLang = useCallback( (event: React.ChangeEvent) => { - const language = event.currentTarget.value - Settings.defaultLocale = language - i18n.changeLanguage(language).catch((error: Error) => log.error('Error while switching language', error)) + i18n + .changeLanguage(event.currentTarget.value) + .catch((error: Error) => log.error('Error while switching language', error)) }, [i18n] )