Files
meet/src/frontend/src/i18n/useLanguageLabels.ts
T
Villaquiranm a20a0a6b38 🌐(i18n) add Spanish language support
Add Spanish to the language selection system on both trees, with 872
frontend phrases and 145 backend ones translated from the French source.

The frontend to backend language map gains it too, so a Spanish browser
does not write an empty language to the account on every load.
2026-08-31 13:59:21 +02:00

30 lines
705 B
TypeScript

import { useTranslation } from 'react-i18next'
const languageLabels: Record<string, string> = {
en: 'English',
fr: 'Français',
de: 'Deutsch',
nl: 'Nederlands',
es: 'Español',
}
export const useLanguageLabels = () => {
const { i18n } = useTranslation()
// cimode is a testing value from i18next, don't include it
const supportedLanguages = (i18n.options.supportedLngs || []).filter(
(lang) => lang !== 'cimode'
)
const languagesList = supportedLanguages.map((lang) => ({
key: lang,
value: lang,
label: languageLabels[lang],
}))
return {
languagesList,
currentLanguage: {
key: i18n.language,
label: languageLabels[i18n.language],
},
}
}