diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 9ab9cbb53..599c4da78 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -21,6 +21,7 @@ export const SUPPORTED_LOCALES = { 'hu-HU': 'Magyar', 'ar-SA': 'اَلْعَرَبِيَّةُ', 'sl-SI': 'Slovenščina', + // IMPORTANT: Also add new languages to useDayjsLanguageSync } as const export type SupportedLocale = keyof typeof SUPPORTED_LOCALES diff --git a/src/i18n/useDayjsLanguageSync.ts b/src/i18n/useDayjsLanguageSync.ts index f3d314726..f90b69069 100644 --- a/src/i18n/useDayjsLanguageSync.ts +++ b/src/i18n/useDayjsLanguageSync.ts @@ -15,6 +15,13 @@ export const DAYJS_LOCALE_MAPPING = { 'nl-nl': 'nl', 'pt-pt': 'pt', 'zh-cn': 'zh-cn', + 'no-NO': 'nn', + 'es-ES': 'es', + 'da-DK': 'da', + 'ja-JP': 'ja', + 'hu-HU': 'hu', + 'ar-SA': 'ar-sa', + 'sl-SI': 'sl', } as Record export const DAYJS_LANGUAGE_IMPORTS = { @@ -29,6 +36,13 @@ export const DAYJS_LANGUAGE_IMPORTS = { 'nl-nl': () => import('dayjs/locale/nl'), 'pt-pt': () => import('dayjs/locale/pt'), 'zh-cn': () => import('dayjs/locale/zh-cn'), + 'no-no': () => import('dayjs/locale/nn'), + 'es-es': () => import('dayjs/locale/es'), + 'da-dk': () => import('dayjs/locale/da'), + 'ja-jp': () => import('dayjs/locale/ja'), + 'hu-hu': () => import('dayjs/locale/hu'), + 'ar-sa': () => import('dayjs/locale/ar-sa'), + 'sl-si': () => import('dayjs/locale/sl'), } as Record Promise> export function useDayjsLanguageSync(dayjsGlobal: typeof dayjs) {