mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix translations for AddPersons in PickEntity
This commit is contained in:
parent
a40077e91b
commit
95027e93c6
@ -1,6 +1,9 @@
|
|||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import PickEntity from 'ChillMainAssets/vuejs/PickEntity/PickEntity.vue';
|
import PickEntity from 'ChillMainAssets/vuejs/PickEntity/PickEntity.vue';
|
||||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n';
|
||||||
|
import { appMessages } from 'ChillMainAssets/vuejs/PickEntity/i18n';
|
||||||
|
|
||||||
|
const i18n = _createI18n(appMessages);
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function(e) {
|
window.addEventListener('DOMContentLoaded', function(e) {
|
||||||
|
|
||||||
@ -11,8 +14,7 @@ window.addEventListener('DOMContentLoaded', function(e) {
|
|||||||
const
|
const
|
||||||
isMultiple = parseInt(el.dataset.multiple) === 1,
|
isMultiple = parseInt(el.dataset.multiple) === 1,
|
||||||
input = document.querySelector('[data-input-uniqid="'+ el.dataset.uniqid +'"]'),
|
input = document.querySelector('[data-input-uniqid="'+ el.dataset.uniqid +'"]'),
|
||||||
picked = isMultiple ? JSON.parse(input.value) : [JSON.parse(input.value)],
|
picked = isMultiple ? JSON.parse(input.value) : [JSON.parse(input.value)];
|
||||||
i18n = _createI18n({});
|
|
||||||
|
|
||||||
createApp({
|
createApp({
|
||||||
template: '<pick-entity ' +
|
template: '<pick-entity ' +
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
<AddPersons
|
<AddPersons
|
||||||
:options="addPersonsOptions"
|
:options="addPersonsOptions"
|
||||||
:key="uniqid"
|
:key="uniqid"
|
||||||
buttonTitle="pick_person.add"
|
:buttonTitle="translatedListOfTypes"
|
||||||
modalTitle="translatedListOfTypes"
|
:modalTitle="translatedListOfTypes"
|
||||||
ref="addPersons"
|
ref="addPersons"
|
||||||
@addNewPersons="addNewEntity"
|
@addNewPersons="addNewEntity"
|
||||||
>
|
>
|
||||||
@ -21,13 +21,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||||
import messages from "./i18n";
|
import { appMessages } from "./i18n";
|
||||||
|
|
||||||
console.log('messages', messages);
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PickEntity",
|
name: "PickEntity",
|
||||||
messages,
|
|
||||||
props: {
|
props: {
|
||||||
multiple: {
|
multiple: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -69,10 +66,9 @@ export default {
|
|||||||
translatedListOfTypes() {
|
translatedListOfTypes() {
|
||||||
let trans = [];
|
let trans = [];
|
||||||
this.types.forEach(t => {
|
this.types.forEach(t => {
|
||||||
trans.push(this.$t('pick_entity.'.t));
|
trans.push(appMessages.fr.pick_entity[t].toLowerCase());
|
||||||
})
|
})
|
||||||
|
return appMessages.fr.pick_entity.modal_title + trans.join(', ');
|
||||||
return trans.join(', ');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n';
|
||||||
|
|
||||||
const messages = {
|
const appMessages = {
|
||||||
fr: {
|
fr: {
|
||||||
pick_entity: {
|
pick_entity: {
|
||||||
add: 'Ajouter',
|
add: 'Ajouter',
|
||||||
modal_title: 'Ajouter des',
|
modal_title: 'Ajouter des ',
|
||||||
user: 'Utilisateurs',
|
user: 'Utilisateurs',
|
||||||
person: 'Usagers',
|
person: 'Usagers',
|
||||||
thirdparty: 'Tiers',
|
thirdparty: 'Tiers',
|
||||||
@ -12,6 +12,6 @@ const messages = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const full = Object.assign(messages, personMessages);
|
Object.assign(appMessages.fr, personMessages.fr);
|
||||||
|
|
||||||
export default full;
|
export { appMessages };
|
||||||
|
@ -93,11 +93,9 @@ import PersonSuggestion from './AddPersons/PersonSuggestion';
|
|||||||
import { searchEntities } from 'ChillPersonAssets/vuejs/_api/AddPersons';
|
import { searchEntities } from 'ChillPersonAssets/vuejs/_api/AddPersons';
|
||||||
import { postPerson } from "ChillPersonAssets/vuejs/_api/OnTheFly";
|
import { postPerson } from "ChillPersonAssets/vuejs/_api/OnTheFly";
|
||||||
import { postThirdparty } from "ChillThirdPartyAssets/vuejs/_api/OnTheFly";
|
import { postThirdparty } from "ChillThirdPartyAssets/vuejs/_api/OnTheFly";
|
||||||
import {messages} from 'ChillPersonAssets/vuejs/_js/i18n.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddPersons',
|
name: 'AddPersons',
|
||||||
messages,
|
|
||||||
components: {
|
components: {
|
||||||
Modal,
|
Modal,
|
||||||
PersonSuggestion,
|
PersonSuggestion,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user