translate units

This commit is contained in:
boerniee
2023-01-13 23:24:42 +01:00
parent 961ec30065
commit bb68c8c504
15 changed files with 77 additions and 130 deletions

View File

@@ -16,62 +16,10 @@ function loadLocaleMessages () {
return messages
}
const dateTimeFormats = {
'en-US': {
short: {
year: 'numeric',
month: 'short',
day: 'numeric'
},
long: {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric'
}
},
'de-DE': {
short: {
year: 'numeric',
month: 'short',
day: 'numeric'
},
long: {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
hour12: false
}
}
}
const numberFormats = {
'en-US': {
currency: {
style: 'currency',
currency: 'USD'
}
},
'de-DE': {
currency: {
style: 'currency',
currency: 'EUR',
currencyDisplay: 'symbol'
}
}
}
const i18n = new VueI18n({
locale: navigator.language.split('-')[0] || 'en',
fallbackLocale: 'en',
messages: loadLocaleMessages(),
numberFormats,
dateTimeFormats
messages: loadLocaleMessages()
});
export default i18n;