moved t function to global and misc cleanup

This commit is contained in:
2020-04-04 17:06:25 +00:00
parent 90c388ecc2
commit 43de3c8fb0
20 changed files with 242 additions and 286 deletions

View File

@@ -24,7 +24,7 @@
item-text="name"
item-value="id"
:readonly="formState.readOnly"
:label="t('Translation')"
:label="$ay.t('Translation')"
ref="translationId"
:error-messages="form().serverErrors(this, 'translationId')"
@input="fieldValueChanged('translationId')"
@@ -37,7 +37,7 @@
:readonly="formState.readOnly"
clearable
@click:clear="fieldValueChanged('emailAddress')"
:label="t('UserEmailAddress')"
:label="$ay.t('UserEmailAddress')"
:error-messages="form().serverErrors(this, 'emailAddress')"
ref="emailAddress"
@input="fieldValueChanged('emailAddress')"
@@ -51,7 +51,7 @@
:readonly="formState.readOnly"
clearable
@click:clear="fieldValueChanged('currencyName')"
:label="t('CurrencyCode')"
:label="$ay.t('CurrencyCode')"
:rules="[form().required(this, 'currencyName')]"
:error-messages="form().serverErrors(this, 'currencyName')"
ref="currencyName"
@@ -62,7 +62,7 @@
<v-checkbox
v-model="obj.hour12"
:readonly="formState.readOnly"
:label="t('Hour12')"
:label="$ay.t('Hour12')"
ref="hour12"
:error-messages="form().serverErrors(this, 'hour12')"
@change="fieldValueChanged('hour12')"
@@ -71,7 +71,7 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<!-- https://vuetifyjs.com/en/components/color-pickers -->
<span class="v-label v-label--active theme--light">
{{ t("UserColor") }}
{{ $ay.t("UserColor") }}
</span>
<v-color-picker
v-model="obj.uiColor"
@@ -91,7 +91,7 @@
:readonly="formState.readOnly"
clearable
@click:clear="fieldValueChanged('languageOverride')"
:label="t('LanguageCode')"
:label="$ay.t('LanguageCode')"
:error-messages="form().serverErrors(this, 'languageOverride')"
ref="languageOverride"
@input="fieldValueChanged('languageOverride')"
@@ -105,7 +105,7 @@
:readonly="formState.readOnly"
clearable
@click:clear="fieldValueChanged('timeZoneOverride')"
:label="t('TimeZone')"
:label="$ay.t('TimeZone')"
:error-messages="form().serverErrors(this, 'timeZoneOverride')"
ref="timeZoneOverride"
@input="fieldValueChanged('timeZoneOverride')"
@@ -231,9 +231,6 @@ export default {
}
},
methods: {
t(tKey) {
return window.$gz.translation.get(tKey);
},
translation() {
return window.$gz.translation;
},
@@ -263,7 +260,10 @@ export default {
//Not found?
if (res.error.code == "2010") {
//notify not found error then navigate backwards
window.$gz.eventBus.$emit("notify-error", vm.t("ErrorAPI2010"));
window.$gz.eventBus.$emit(
"notify-error",
vm.$ay.t("ErrorAPI2010")
);
// navigate backwards
window.$gz._.delay(function() {
vm.$router.go(-1);