2021-09-20 12:18:40 +02:00
|
|
|
/* eslint-disable import/no-duplicates */
|
|
|
|
import { Locale } from 'date-fns'
|
2022-06-24 20:44:26 +02:00
|
|
|
import { de, enUS, fr } from 'date-fns/locale'
|
2021-09-20 12:18:40 +02:00
|
|
|
|
2021-10-31 19:48:49 +01:00
|
|
|
import createI18n from '@/i18n'
|
|
|
|
|
2021-09-20 12:18:40 +02:00
|
|
|
export const localeFromLanguage: Record<string, Locale> = {
|
2022-06-24 20:44:26 +02:00
|
|
|
de: de,
|
2021-09-20 12:18:40 +02:00
|
|
|
en: enUS,
|
|
|
|
fr: fr,
|
|
|
|
}
|
2021-10-31 19:48:49 +01:00
|
|
|
|
|
|
|
export const languageLabels: Record<string, string> = {
|
2022-06-24 20:44:26 +02:00
|
|
|
de: 'Deutsch',
|
2021-10-31 19:48:49 +01:00
|
|
|
en: 'English',
|
|
|
|
fr: 'Français',
|
|
|
|
}
|
|
|
|
|
|
|
|
const { availableLocales } = createI18n.global
|
|
|
|
export const availableLanguages = availableLocales.map((l) => {
|
|
|
|
return { label: languageLabels[l], value: l }
|
|
|
|
})
|