mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
improve inheritance with translations i18n.js files
vue-i18n --> chill main i18n ---( )---> app index chill bundle i18n --> app i18n --^
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>{{ $t('title.course') }}</h3>
|
||||
<h3>{{ $t('course.title') }}</h3>
|
||||
<dl>
|
||||
<dt>{{ $t('course.id') }}</dt>
|
||||
<dd>{{ accompanying_course.id }}</dd>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>{{ $t('title.persons_associated')}}</h3>
|
||||
<h3>{{ $t('persons_associated.title')}}</h3>
|
||||
<label>{{ $tc('persons_associated.counter', counter) }}</label>
|
||||
<table class="rounded">
|
||||
<thead>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>{{ $t('title.requestor') }}</h3>
|
||||
<h3>{{ $t('requestor.title') }}</h3>
|
||||
{{ accompanying_course.id }}
|
||||
{{ accompanying_course.remark }}<br><br>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="sc-button bt-create" @click="modal1.showModal = true">
|
||||
{{ $t('action.showModal') }}
|
||||
{{ $t('action.show_modal') }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import { datetimeFormats, messages } from './js/i18n'
|
||||
import { getDataPromise, postDataPromise } from './store'
|
||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
import { appMessages } from './js/i18n'
|
||||
import { getDataPromise } from './store'
|
||||
|
||||
import App from './App.vue';
|
||||
|
||||
@@ -10,12 +10,7 @@ getDataPromise.then(store => {
|
||||
//console.log('store in create_store', store);
|
||||
console.log('store accompanyingCourse', store.state.accompanying_course);
|
||||
|
||||
const i18n = createI18n({
|
||||
datetimeFormats,
|
||||
messages,
|
||||
locale: 'fr',
|
||||
fallbackLocale: 'fr'
|
||||
});
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
|
@@ -1,33 +1,32 @@
|
||||
import { datetimeFormats, personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
|
||||
const messages = {
|
||||
const appMessages = {
|
||||
fr: {
|
||||
title: {
|
||||
course: "Parcours",
|
||||
persons_associated: "Usagers concernés",
|
||||
requestor: "Demandeur",
|
||||
},
|
||||
course: {
|
||||
id: "id",
|
||||
title: "Parcours",
|
||||
opening_date: "Date d'ouverture",
|
||||
closing_date: "Date de clôture",
|
||||
remark: "Commentaire",
|
||||
closing_motive: "Motif de clôture",
|
||||
},
|
||||
persons_associated: {
|
||||
title: "Usagers concernés",
|
||||
counter: "Pas d'usager | 1 usager | {count} usagers",
|
||||
firstname: "Prénom",
|
||||
lastname: "Nom",
|
||||
startdate: "Date d'entrée",
|
||||
enddate: "Date de sortie",
|
||||
addPerson: "Ajouter un usager",
|
||||
}
|
||||
},
|
||||
requestor: {
|
||||
title: "Demandeur",
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Object.assign(messages.fr, personMessages.fr);
|
||||
Object.assign(appMessages.fr, personMessages.fr);
|
||||
|
||||
export {
|
||||
datetimeFormats,
|
||||
messages
|
||||
appMessages
|
||||
};
|
||||
|
Reference in New Issue
Block a user