🐛(languages) fix currentLanguage in profile menu (#1108)

Fix currentLanguage in profile menu
This commit is contained in:
Eléonore
2026-04-14 14:58:22 +00:00
committed by GitHub
parent fd1052155d
commit dcf8a8ce09
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -20,6 +20,7 @@ and this project adheres to
### Fixed
- 🐛(languages) fix currentLanguage in profile menu
- ✨(mailboxes) enforce lowercase on mailboxes
- 🐛(i18n) fix missing translations for status tag labels
- 🚚(route) prioritize mail domains as default landing page
@@ -10,11 +10,13 @@ export const LanguagePicker = () => {
const { i18n } = useTranslation();
const { preload: languages } = i18n.options;
Settings.defaultLocale = i18n.language;
const currentLanguage = Settings.defaultLocale;
const optionsPicker = useMemo(() => {
return (languages || []).map((lang) => ({
value: lang,
label: LANGUAGES_ALLOWED[lang],
isChecked: lang === currentLanguage,
render: () => (
<Box
className="c_select__render"
@@ -29,16 +31,17 @@ export const LanguagePicker = () => {
</Box>
),
}));
}, [languages]);
}, [languages, currentLanguage]);
useEffect(() => {
if (typeof document !== 'undefined') {
document.documentElement.lang = i18n.language;
document.documentElement.lang = currentLanguage || i18n.language;
}
}, [i18n.language]);
}, [currentLanguage, i18n.language]);
return (
<LanguagePickerUi
key={currentLanguage}
languages={optionsPicker}
size="small"
onChange={(selected) => {