makondratev
2024-02-18 8c5c5f9130c65fcc48412a24b0a6c98b254f1934
quartz/i18n/index.ts
@@ -1,4 +1,4 @@
import { Translation } from "./locales/definition"
import { Translation, CalloutTranslation } from "./locales/definition"
import en from "./locales/en-US"
import fr from "./locales/fr-FR"
import ja from "./locales/ja-JP"
@@ -8,6 +8,7 @@
import es from "./locales/es-ES"
import ar from "./locales/ar-SA"
import uk from "./locales/uk-UA"
import ru from "./locales/ru-RU"
export const TRANSLATIONS = {
  "en-US": en,
@@ -15,6 +16,7 @@
  "ja-JP": ja,
  "de-DE": de,
  "nl-NL": nl,
  "nl-BE": nl,
  "ro-RO": ro,
  "ro-MD": ro,
  "es-ES": es,
@@ -39,8 +41,10 @@
  "ar-DZ": ar,
  "ar-MR": ar,
  "uk-UA": uk,
  "ru-RU": ru,
} as const
export const defaultTranslation = "en-US"
export const i18n = (locale: ValidLocale): Translation => TRANSLATIONS[locale ?? defaultTranslation]
export type ValidLocale = keyof typeof TRANSLATIONS
export type ValidCallout = keyof CalloutTranslation