From 5f1e163eb683abc8b4e79e7e7ce799c1c35779a6 Mon Sep 17 00:00:00 2001 From: user12224 <122770437+user12224@users.noreply.github.com> Date: Fri, 14 Mar 2025 21:51:40 +0200 Subject: [PATCH] chore(i18n): config --- apps/mail/i18n/config.ts | 57 ++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/apps/mail/i18n/config.ts b/apps/mail/i18n/config.ts index 771002c478..42861650d7 100644 --- a/apps/mail/i18n/config.ts +++ b/apps/mail/i18n/config.ts @@ -1,35 +1,28 @@ -export type Locale = (typeof locales)[number]; +const LANGUAGES = { + en: "English", + ar: "Arabic", + ca: "Catalan", + de: "German", + es: "Spanish", + fr: "French", + hi: "Hindi", + ja: "Japanese", + ko: "Korean", + pl: "Polish", + pt: "Portuguese", + ru: "Russian", + tr: "Turkish" +} as const; -export const availableLocales = [ - { - code: "en", - name: "English", - }, - { - code: "ar", - name: "Arabic", - }, - { - code: "fr", - name: "French", - }, - { - code: "tr", - name: "Turkish", - }, - { - code: "es-ES", - name: "Spanish", - }, - { - code: "de", - name: "German", - }, - { - code: "pt-PT", - name: "Portuguese", - }, -]; +export type Locale = keyof typeof LANGUAGES; + +export const languageConfig = LANGUAGES; -export const locales = availableLocales.map((locale) => locale.code); export const defaultLocale: Locale = "en"; + +export const locales: Locale[] = Object.keys(LANGUAGES) as Locale[]; + +export const availableLocales = locales.map(code => ({ + code, + name: LANGUAGES[code] +})); \ No newline at end of file