gradido/frontend/src/i18n.js
MateuszMichalowski cdaca99b04
feat(frontend): migration setup (#3342)
* frontend - moved to vue 2.7 and vite

* frontend - moved to vue 3

* frontend - login page updates

* fix(frontend): WiP migration

* fix(frontend): WiP migration

* fix(frontend): WiP migration

* fix(frontend): WiP migration

* fix(frontend): WiP migration

* fix(frontend): fix eslint/stylelint issues

* fix(frontend): fix eslint/stylelint issues

* feature(frontend): update node in docker frontend

* feature(frontend): move send types out of Send file

* feature(frontend): add entry in package json to fix eslint issue

* feature(frontend): eslint fix

* replace docker-compose with docker compose

* update docker-compose test file

* feature(frontend): Creation fixes

* feature(frontend): Add missing updates for apollo scripts.

---------

Co-authored-by: einhornimmond <silas@einhornimmond.de>
2024-08-08 23:02:15 +02:00

244 lines
4.2 KiB
JavaScript

import { createI18n } from 'vue-i18n'
import de from './locales/de.json'
import en from './locales/en.json'
import es from './locales/es.json'
import fr from './locales/fr.json'
import nl from './locales/nl.json'
import tr from './locales/tr.json'
const numberFormats = {
en: {
decimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
ungroupedDecimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
useGrouping: false,
},
},
de: {
decimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
ungroupedDecimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
useGrouping: false,
},
},
es: {
decimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
ungroupedDecimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
useGrouping: false,
},
},
fr: {
decimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
ungroupedDecimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
useGrouping: false,
},
},
nl: {
decimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
ungroupedDecimal: {
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
useGrouping: false,
},
},
}
const datetimeFormats = {
en: {
short: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
},
long: {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
},
monthShort: {
month: 'short',
},
month: {
month: 'long',
},
year: {
year: 'numeric',
},
monthAndYear: {
month: 'long',
year: 'numeric',
},
time: {
hour: 'numeric',
minute: 'numeric',
},
},
de: {
short: {
day: 'numeric',
month: 'numeric',
year: 'numeric',
},
long: {
day: 'numeric',
month: 'long',
year: 'numeric',
hour: 'numeric',
minute: 'numeric',
},
monthShort: {
month: 'short',
},
month: {
month: 'long',
},
year: {
year: 'numeric',
},
monthAndYear: {
month: 'long',
year: 'numeric',
},
time: {
hour: 'numeric',
minute: 'numeric',
},
},
es: {
short: {
day: 'numeric',
month: 'numeric',
year: 'numeric',
},
long: {
day: 'numeric',
month: 'long',
year: 'numeric',
hour: 'numeric',
minute: 'numeric',
},
monthShort: {
month: 'short',
},
month: {
month: 'long',
},
year: {
year: 'numeric',
},
monthAndYear: {
month: 'long',
year: 'numeric',
},
time: {
hour: 'numeric',
minute: 'numeric',
},
},
fr: {
short: {
day: 'numeric',
month: 'numeric',
year: 'numeric',
},
long: {
day: 'numeric',
month: 'long',
year: 'numeric',
hour: 'numeric',
minute: 'numeric',
},
monthShort: {
month: 'short',
},
month: {
month: 'long',
},
year: {
year: 'numeric',
},
monthAndYear: {
month: 'long',
year: 'numeric',
},
time: {
hour: 'numeric',
minute: 'numeric',
},
},
nl: {
short: {
day: 'numeric',
month: 'numeric',
year: 'numeric',
},
long: {
day: 'numeric',
month: 'long',
year: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},
monthShort: {
month: 'short',
},
month: {
month: 'long',
},
year: {
year: 'numeric',
},
monthAndYear: {
month: 'long',
year: 'numeric',
},
time: {
hour: 'numeric',
minute: 'numeric',
},
},
}
export default createI18n({
locale: 'en',
legacy: false,
fallbackLocale: 'en',
messages: { de, en, es, fr, tr, nl },
numberFormats,
datetimeFormats,
})