Skip to content

Commit

Permalink
Configure all locales with translations for date rendering and date p…
Browse files Browse the repository at this point in the history
…icker configuration
  • Loading branch information
ifox committed Feb 4, 2024
1 parent 5073e74 commit eb21fa9
Showing 1 changed file with 56 additions and 16 deletions.
72 changes: 56 additions & 16 deletions frontend/js/utils/locale.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,87 @@
import { German } from 'flatpickr/dist/l10n/de.js'
import { French } from 'flatpickr/dist/l10n/fr.js'
import { Arabic } from 'flatpickr/dist/l10n/ar.js'
import { Bosnian } from 'flatpickr/dist/l10n/bs.js'
import { Czech } from 'flatpickr/dist/l10n/cs.js'
import { Dutch } from 'flatpickr/dist/l10n/nl.js'
import { French } from 'flatpickr/dist/l10n/fr.js'
import { German } from 'flatpickr/dist/l10n/de.js'
import { Italian } from 'flatpickr/dist/l10n/it.js'
import { Mandarin } from 'flatpickr/dist/l10n/zh.js'
import { Norwegian } from 'flatpickr/dist/l10n/no.js'
import { Polish } from 'flatpickr/dist/l10n/pl.js'
import { Portuguese } from 'flatpickr/dist/l10n/pt.js'
import { Russian } from 'flatpickr/dist/l10n/ru.js'
import { Slovenian } from 'flatpickr/dist/l10n/sl.js'
import { Spanish } from 'flatpickr/dist/l10n/es.js'
import { Turkish } from 'flatpickr/dist/l10n/tr.js'
import { Mandarin } from 'flatpickr/dist/l10n/zh.js'
import { Ukrainian } from 'flatpickr/dist/l10n/uk.js'

export const locales = {
en: {
'date-fns': require('date-fns/locale/en')
},
'zh-Hans': {
'date-fns': require('date-fns/locale/zh_cn'),
flatpickr: Mandarin
},
ru: {
'date-fns': require('date-fns/locale/ru'),
flatpickr: Russian
ar: {
'date-fns': require('date-fns/locale/ar'),
flatpickr: Arabic
},
fr: {
'date-fns': require('date-fns/locale/fr'),
flatpickr: French
bs: {
'date-fns': require('date-fns/locale/en'), // TODO: update date-fns to add support for bs
flatpickr: Bosnian
},
pl: {
'date-fns': require('date-fns/locale/pl'),
flatpickr: Polish
cs: {
'date-fns': require('date-fns/locale/cs'),
flatpickr: Czech
},
de: {
'date-fns': require('date-fns/locale/de'),
flatpickr: German
},
es: {
'date-fns': require('date-fns/locale/es'),
flatpickr: Spanish
},
fr: {
'date-fns': require('date-fns/locale/fr'),
flatpickr: French
},
it: {
'date-fns': require('date-fns/locale/it'),
flatpickr: Italian
},
nl: {
'date-fns': require('date-fns/locale/nl'),
flatpickr: Dutch
},
no: {
'date-fns': require('date-fns/locale/en'), // TODO: update date-fns to add support for no
flatpickr: Norwegian
},
pl: {
'date-fns': require('date-fns/locale/pl'),
flatpickr: Polish
},
pt: {
'date-fns': require('date-fns/locale/pt'),
flatpickr: Portuguese
},
ru: {
'date-fns': require('date-fns/locale/ru'),
flatpickr: Russian
},
sl: {
'date-fns': require('date-fns/locale/sl'),
flatpickr: Slovenian
},
tr: {
'date-fns': require('date-fns/locale/tr'),
flatpickr: Turkish
},
uk: {
'date-fns': require('date-fns/locale/en'), // TODO: update date-fns to add support for uk
flatpickr: Ukrainian
},
'zh-Hans': {
'date-fns': require('date-fns/locale/zh_cn'),
flatpickr: Mandarin
}
}

Expand Down

0 comments on commit eb21fa9

Please sign in to comment.