improve inheritance with translations i18n.js files

vue-i18n --> chill main i18n ---( )---> app index
chill bundle i18n --> app i18n --^
This commit is contained in:
2021-04-30 14:59:14 +02:00
parent ec68e6f761
commit 4900c81c11
7 changed files with 74 additions and 59 deletions

View File

@@ -0,0 +1,52 @@
import { createI18n } from 'vue-i18n'
const datetimeFormats = {
fr: {
short: {
year: "numeric",
month: "numeric",
day: "numeric"
},
long: {
year: "numeric",
month: "short",
day: "numeric",
weekday: "short",
hour: "numeric",
minute: "numeric",
hour12: false
}
}
};
const messages = {
fr: {
action: {
actions: "Actions",
show: "Voir",
edit: "Modifier",
create: "Créer",
remove: "Enlever",
delete: "Supprimer",
save: "Enregistrer",
show_modal: "Ouvrir une modale",
ok: "OK",
cancel: "Annuler",
close: "Fermer",
next: "Suivant",
previous: "Précédent",
back: "Retour"
},
}
};
const _createI18n = (appMessages) => {
Object.assign(messages.fr, appMessages.fr);
return createI18n({
datetimeFormats,
messages,
locale: 'fr',
fallbackLocale: 'fr'
})
};
export { _createI18n }