Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
import { i18nLocaleSupported } from '@sync-in-server/backend/src/common/i18n'
import { dJs } from '../../app/common/utils/time'
const DAYJS_LOADER: Record<i18nLocaleSupported, () => Promise<ILocale>> = {
ca: () => import('dayjs/esm/locale/ca'),
de: () => import('dayjs/esm/locale/de'),
en: () => import('dayjs/esm/locale/en'),
es: () => import('dayjs/esm/locale/es'),
fr: () => import('dayjs/esm/locale/fr'),
hi: () => import('dayjs/esm/locale/hi'),
it: () => import('dayjs/esm/locale/it'),
ja: () => import('dayjs/esm/locale/ja'),
ko: () => import('dayjs/esm/locale/ko'),
nl: () => import('dayjs/esm/locale/nl'),
pl: () => import('dayjs/esm/locale/pl'),
pt: () => import('dayjs/esm/locale/pt'),
'pt-BR': () => import('dayjs/esm/locale/pt-br'),
ru: () => import('dayjs/esm/locale/ru'),
tr: () => import('dayjs/esm/locale/tr'),
zh: () => import('dayjs/esm/locale/zh')
}
export async function loadDayjsLocale(language: string) {
const loader = DAYJS_LOADER[language]
if (!loader) return
await loader()
dJs.locale(language)
}