fix(gantt): correctly import languages from dayjs
Resolves https://community.vikunja.io/t/error-in-gannt-with-spanish-language/1973/3
This commit is contained in:
parent
45f5d522d1
commit
5b2a9a42c0
@ -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
|
||||
|
@ -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<SupportedLocale, ISOLanguage>
|
||||
|
||||
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<SupportedLocale, () => Promise<ILocale>>
|
||||
|
||||
export function useDayjsLanguageSync(dayjsGlobal: typeof dayjs) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user