From fa56b99f6f775a782dddb222b45c813a8c02c4ac Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 5 Feb 2020 23:06:27 +0000 Subject: [PATCH] --- ayanova/src/App.vue | 1 + ayanova/src/api/locale.js | 14 +++++++++++++- ayanova/src/components/date-control.vue | 9 ++++++++- ayanova/src/components/date-time-control.vue | 14 +++++++++++--- ayanova/src/components/time-control.vue | 9 ++++++++- 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index 57635a70..22884f14 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -244,6 +244,7 @@ export default { window.$gz.menu.wireUpEventHandlers(this); window.$gz.dialog.wireUpEventHandlers(this); openObjectHandler.wireUpEventHandlers(this); + window.$gz.locale.setVuetifyDefaultLanguageElements(this); }, beforeDestroy() { //UNWIRE ALL EVENT HANDLERS FROM GZEVENTBUS diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index d546ed39..be81e4be 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -154,7 +154,9 @@ export default { "ObjectCustomFieldCustomGrid", "RowsPerPage", "PageOfPageText", - "Loading" + "Loading", + "AM", + "PM" ], decimalValidate(required) { return { required: required, decimal: [2, this.format().decimalSeparator] }; @@ -240,5 +242,15 @@ export default { } return shortLanguage; + }, + //////////////////////////////////////////////////////// + // dynamically set the vuetify language elements from + // users localized text (am/pm etc) + // Keeping vuetify using en locale and just adjusting on top of that + // + setVuetifyDefaultLanguageElements(vm) { + vm.$vuetify.lang.locales.en.close = this.get("OK"); + vm.$vuetify.lang.locales.en.timePicker.am = this.get("AM"); + vm.$vuetify.lang.locales.en.timePicker.pm = this.get("PM"); } }; diff --git a/ayanova/src/components/date-control.vue b/ayanova/src/components/date-control.vue index 96dbc114..5e86fb4b 100644 --- a/ayanova/src/components/date-control.vue +++ b/ayanova/src/components/date-control.vue @@ -17,7 +17,9 @@ - Close + {{ + lt("OK") + }} @@ -67,6 +69,11 @@ export default { required: false } }, + methods: { + lt(ltKey) { + return window.$gz.locale.get(ltKey); + } + }, watch: { date() { //this tortuous fuckery is required so that the input and change events only fire on a real change, not initial page load diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index 0243f0b8..d434675a 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -27,7 +27,9 @@ :locale="defaultLocale" > - Close + {{ + lt("OK") + }} @@ -56,7 +58,9 @@ v-model="timeOnly" > - OK + {{ + lt("OK") + }} @@ -71,7 +75,6 @@

{{ error }}

- {{ defaultLocale }}