diff --git a/src/frontend/src/i18n/useLanguageLabels.ts b/src/frontend/src/i18n/useLanguageLabels.ts index 6a5d7936..31980bb5 100644 --- a/src/frontend/src/i18n/useLanguageLabels.ts +++ b/src/frontend/src/i18n/useLanguageLabels.ts @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next' -const langageLabels: Record = { +const languageLabels: Record = { en: 'English', fr: 'Français', de: 'Deutsch', @@ -13,14 +13,15 @@ export const useLanguageLabels = () => { (lang) => lang !== 'cimode' ) const languagesList = supportedLanguages.map((lang) => ({ + key: lang, value: lang, - label: langageLabels[lang], + label: languageLabels[lang], })) return { languagesList, currentLanguage: { key: i18n.language, - label: langageLabels[i18n.language], + label: languageLabels[i18n.language], }, } } diff --git a/src/frontend/src/layout/Header.tsx b/src/frontend/src/layout/Header.tsx index 36fc41c7..103f4bab 100644 --- a/src/frontend/src/layout/Header.tsx +++ b/src/frontend/src/layout/Header.tsx @@ -74,7 +74,7 @@ export const Header = () => { {user.email} { if (value === 'logout') { window.location.href = logoutUrl() diff --git a/src/frontend/src/primitives/PopoverList.tsx b/src/frontend/src/primitives/PopoverList.tsx index 61d74fc4..fd393d0c 100644 --- a/src/frontend/src/primitives/PopoverList.tsx +++ b/src/frontend/src/primitives/PopoverList.tsx @@ -42,7 +42,7 @@ export const PopoverList = ({ }: { closeOnAction?: boolean onAction: (key: T) => void - items: Array + items: Array } & ButtonProps) => { const popoverState = useContext(OverlayTriggerStateContext)! return ( @@ -50,8 +50,9 @@ export const PopoverList = ({ {items.map((item) => { const value = typeof item === 'string' ? item : item.value const label = typeof item === 'string' ? item : item.label + const key = typeof item === 'string' ? item : item.key return ( -
  • +
  • {