From e793b3dd93c58f4cebab2f3226f4392bd15f568f Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 13 Mar 2024 15:06:02 +0100 Subject: [PATCH] feat: refs #5186 use global locales --- src/components/LeftMenuItem.vue | 10 +++++-- src/components/common/VnBreadcrumbs.vue | 16 +++++++---- src/i18n/en/index.js | 30 +++++++------------- src/i18n/es/index.js | 27 ++++++------------ src/pages/Parking/Card/ParkingBasicData.vue | 13 ++++----- src/pages/Parking/Card/ParkingDescriptor.vue | 12 ++------ src/pages/Parking/Card/ParkingSummary.vue | 12 ++++---- src/pages/Parking/ParkingList.vue | 2 +- 8 files changed, 52 insertions(+), 70 deletions(-) diff --git a/src/components/LeftMenuItem.vue b/src/components/LeftMenuItem.vue index 976136394..7e7a7fe72 100644 --- a/src/components/LeftMenuItem.vue +++ b/src/components/LeftMenuItem.vue @@ -2,7 +2,7 @@ import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; -const { t } = useI18n(); +const { t, te } = useI18n(); const props = defineProps({ item: { @@ -11,7 +11,13 @@ const props = defineProps({ }, }); -const item = computed(() => props.item); // eslint-disable-line vue/no-dupe-keys +const item = computed(() => { + const item = JSON.parse(JSON.stringify(props.item)); + const [, , section] = item.title.split('.'); + + if (!te(item.title)) item.title = t(`globals.pageTitles.${section}`); + return item; +}); // eslint-disable-line vue/no-dupe-keys diff --git a/src/pages/Parking/ParkingList.vue b/src/pages/Parking/ParkingList.vue index 1615e99ed..2a1873d5a 100644 --- a/src/pages/Parking/ParkingList.vue +++ b/src/pages/Parking/ParkingList.vue @@ -88,7 +88,7 @@ function exprBuilder(param, value) {