Merge remote-tracking branch 'origin/master'
This commit is contained in:
30
ui/src/i18n/dayjsLocale.js
Normal file
30
ui/src/i18n/dayjsLocale.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import dayjs from 'dayjs'
|
||||
import 'dayjs/locale/tr.js'
|
||||
import 'dayjs/locale/en.js'
|
||||
import 'dayjs/locale/de.js'
|
||||
import 'dayjs/locale/it.js'
|
||||
import 'dayjs/locale/es.js'
|
||||
import 'dayjs/locale/ru.js'
|
||||
import 'dayjs/locale/ar.js'
|
||||
|
||||
import { normalizeLocale } from './languages.js'
|
||||
|
||||
export const DATE_LOCALE_MAP = {
|
||||
tr: 'tr-TR',
|
||||
en: 'en-US',
|
||||
de: 'de-DE',
|
||||
it: 'it-IT',
|
||||
es: 'es-ES',
|
||||
ru: 'ru-RU',
|
||||
ar: 'ar'
|
||||
}
|
||||
|
||||
export function applyDayjsLocale(locale) {
|
||||
const normalized = normalizeLocale(locale)
|
||||
dayjs.locale(normalized)
|
||||
}
|
||||
|
||||
export function getDateLocale(locale) {
|
||||
const normalized = normalizeLocale(locale)
|
||||
return DATE_LOCALE_MAP[normalized] || DATE_LOCALE_MAP.tr
|
||||
}
|
||||
Reference in New Issue
Block a user