mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
improve Address reusability: move i18n translations out of root component
This commit is contained in:
parent
76a4b24aa1
commit
c302452e01
@ -15,7 +15,7 @@
|
|||||||
@close="flag.showPane = false">
|
@close="flag.showPane = false">
|
||||||
|
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<h2 class="modal-title">{{ getTextTitle }}
|
<h2 class="modal-title">{{ $t(getTextTitle) }}
|
||||||
<span v-if="flag.loading" class="loading">
|
<span v-if="flag.loading" class="loading">
|
||||||
<i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
|
<i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
|
||||||
<span class="sr-only">Loading...</span>
|
<span class="sr-only">Loading...</span>
|
||||||
@ -70,7 +70,7 @@
|
|||||||
@close="flag.editPane = false">
|
@close="flag.editPane = false">
|
||||||
|
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<h2 class="modal-title">{{ getTextTitle }}
|
<h2 class="modal-title">{{ $t(getTextTitle) }}
|
||||||
<span v-if="flag.loading" class="loading">
|
<span v-if="flag.loading" class="loading">
|
||||||
<i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
|
<i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
|
||||||
<span class="sr-only">Loading...</span>
|
<span class="sr-only">Loading...</span>
|
||||||
@ -126,9 +126,14 @@ import { postAddressToHousehold } from "ChillPersonAssets/vuejs/_api/AddAddress/
|
|||||||
import ShowAddress from './ShowAddress.vue';
|
import ShowAddress from './ShowAddress.vue';
|
||||||
import EditAddress from './EditAddress.vue';
|
import EditAddress from './EditAddress.vue';
|
||||||
|
|
||||||
|
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||||
|
import { addressMessages } from '../i18n'
|
||||||
|
const i18n = _createI18n(addressMessages);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddAddress",
|
name: "AddAddress",
|
||||||
props: ['context', 'options', 'result'],
|
props: ['context', 'options', 'result'],
|
||||||
|
i18n,
|
||||||
components: {
|
components: {
|
||||||
Modal,
|
Modal,
|
||||||
ShowAddress,
|
ShowAddress,
|
||||||
@ -211,7 +216,7 @@ export default {
|
|||||||
)) {
|
)) {
|
||||||
return (this.context.edit) ? this.options.title.edit : this.options.title.create;
|
return (this.context.edit) ? this.options.title.edit : this.options.title.create;
|
||||||
}
|
}
|
||||||
return (this.context.edit) ? this.$t(this.default.title.edit) : this.$t(this.default.title.create);
|
return (this.context.edit) ? this.default.title.edit : this.default.title.create;
|
||||||
},
|
},
|
||||||
getTextButton() {
|
getTextButton() {
|
||||||
if ( typeof this.options.button.text !== 'undefined'
|
if ( typeof this.options.button.text !== 'undefined'
|
||||||
|
@ -2,10 +2,6 @@ import { createApp } from 'vue'
|
|||||||
import { store } from './store'
|
import { store } from './store'
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
|
|
||||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
|
||||||
import { addressMessages } from './i18n'
|
|
||||||
const i18n = _createI18n(addressMessages);
|
|
||||||
|
|
||||||
const app = createApp({
|
const app = createApp({
|
||||||
template: `<app></app>`,
|
template: `<app></app>`,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user