This commit is contained in:
2020-03-06 20:08:50 +00:00
parent 7318a33350
commit 17bf519cb0
79 changed files with 331 additions and 309 deletions

View File

@@ -27,8 +27,8 @@ export default {
data() {
return {
formattedValue: this.value,
currencyName: window.$gz.locale.getCurrencyName(),
languageName: window.$gz.locale.getBrowserFirstLanguage()
currencyName: window.$gz.translation.getCurrencyName(),
languageName: window.$gz.translation.getBrowserFirstLanguage()
};
},
watch: {
@@ -48,10 +48,10 @@ export default {
},
methods: {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
return window.$gz.translation.get(ltKey);
},
locale() {
return window.$gz.locale;
translation() {
return window.$gz.translation;
},
handleInput(value) {
this.$emit(

View File

@@ -159,7 +159,7 @@ export default {
methods: {
lt: function(ltkey) {
return window.$gz.locale.get(ltkey);
return window.$gz.translation.get(ltkey);
},
form() {
//nothing
@@ -430,8 +430,8 @@ export default {
if (!window.$gz._) {
throw "custom-fields-control: $gz._ (lodash) is required and missing";
}
if (!window.$gz.locale) {
throw "custom-fields-control: $gz.locale is required and missing";
if (!window.$gz.translation) {
throw "custom-fields-control: $gz.translation is required and missing";
}
}
},

View File

@@ -45,9 +45,11 @@ export default {
oldDate: null,
dlgdate: false,
//cache display format stuff
timeZoneName: window.$gz.locale.getBrowserTimeZoneName(),
languageName: window.$gz.locale.getBrowserLanguages(),
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0]
timeZoneName: window.$gz.translation.getBrowserTimeZoneName(),
languageName: window.$gz.translation.getBrowserLanguages(),
defaultLocale: window.$gz.translation
.getBrowserFirstLanguage()
.split("-", 1)[0]
}),
props: {
label: String,
@@ -61,7 +63,7 @@ export default {
},
methods: {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
return window.$gz.translation.get(ltKey);
}
},
watch: {
@@ -84,7 +86,7 @@ export default {
},
computed: {
formatDateTime() {
return window.$gz.locale.utcDateToShortDateAndTimeLocalized(
return window.$gz.translation.utcDateToShortDateAndTimeLocalized(
this.value,
this.timeZoneName,
this.languageName,
@@ -92,14 +94,14 @@ export default {
);
},
formatDate() {
return window.$gz.locale.utcDateToShortDateLocalized(
return window.$gz.translation.utcDateToShortDateLocalized(
this.value,
this.timeZoneName,
this.languageName
);
},
formatTime() {
return window.$gz.locale.utcDateToShortTimeLocalized(
return window.$gz.translation.utcDateToShortTimeLocalized(
this.value,
this.timeZoneName,
this.languageName,
@@ -109,7 +111,7 @@ export default {
dateOnly: {
get() {
//return date only portion converted to local working time zone: YYYY-MM-DD
return window.$gz.locale.utcDateStringToLocal8601DateOnlyString(
return window.$gz.translation.utcDateStringToLocal8601DateOnlyString(
this.value,
this.timeZoneName
);
@@ -120,7 +122,7 @@ export default {
if (!TimePortion) {
TimePortion = "00:00:00";
}
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(
this.date = window.$gz.translation.localTimeDateStringToUTC8601String(
value + "T" + TimePortion,
this.timeZoneName
);
@@ -130,7 +132,7 @@ export default {
//expects just the hours minutes seconds portion: 18:18:49
//Needs to convert into and out of the desired time zone or the control will show the UTC time instead
get() {
return window.$gz.locale.utcDateStringToLocal8601TimeOnlyString(
return window.$gz.translation.utcDateStringToLocal8601TimeOnlyString(
this.value,
this.timeZoneName
);
@@ -152,7 +154,7 @@ export default {
DatePortion = fullYear + "-" + fullMonth + "-" + fullDay;
}
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(
this.date = window.$gz.translation.localTimeDateStringToUTC8601String(
DatePortion + "T" + value,
this.timeZoneName
);

View File

@@ -85,11 +85,13 @@ export default {
dlgdate: false,
dlgtime: false,
//cache display format stuff
timeZoneName: window.$gz.locale.getBrowserTimeZoneName(),
languageName: window.$gz.locale.getBrowserLanguages(),
hour12: window.$gz.locale.getHour12(),
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0]
// ampmFormat: window.$gz.locale.getHour12() ? "ampm" : "24hr"
timeZoneName: window.$gz.translation.getBrowserTimeZoneName(),
languageName: window.$gz.translation.getBrowserLanguages(),
hour12: window.$gz.translation.getHour12(),
defaultLocale: window.$gz.translation
.getBrowserFirstLanguage()
.split("-", 1)[0]
// ampmFormat: window.$gz.translation.getHour12() ? "ampm" : "24hr"
//:format="ampmFormat"
}),
props: {
@@ -104,7 +106,7 @@ export default {
},
methods: {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
return window.$gz.translation.get(ltKey);
}
},
watch: {
@@ -127,7 +129,7 @@ export default {
},
computed: {
formatDateTime() {
return window.$gz.locale.utcDateToShortDateAndTimeLocalized(
return window.$gz.translation.utcDateToShortDateAndTimeLocalized(
this.value,
this.timeZoneName,
this.languageName,
@@ -135,14 +137,14 @@ export default {
);
},
formatDate() {
return window.$gz.locale.utcDateToShortDateLocalized(
return window.$gz.translation.utcDateToShortDateLocalized(
this.value,
this.timeZoneName,
this.languageName
);
},
formatTime() {
return window.$gz.locale.utcDateToShortTimeLocalized(
return window.$gz.translation.utcDateToShortTimeLocalized(
this.value,
this.timeZoneName,
this.languageName,
@@ -152,7 +154,7 @@ export default {
dateOnly: {
get() {
//return date only portion converted to local working time zone: YYYY-MM-DD
return window.$gz.locale.utcDateStringToLocal8601DateOnlyString(
return window.$gz.translation.utcDateStringToLocal8601DateOnlyString(
this.value,
this.timeZoneName
);
@@ -163,7 +165,7 @@ export default {
if (!TimePortion) {
TimePortion = "00:00:00";
}
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(
this.date = window.$gz.translation.localTimeDateStringToUTC8601String(
value + "T" + TimePortion,
this.timeZoneName
);
@@ -173,7 +175,7 @@ export default {
//expects just the hours minutes seconds portion: 18:18:49
//Needs to convert into and out of the desired time zone or the control will show the UTC time instead
get() {
return window.$gz.locale.utcDateStringToLocal8601TimeOnlyString(
return window.$gz.translation.utcDateStringToLocal8601TimeOnlyString(
this.value,
this.timeZoneName
);
@@ -195,7 +197,7 @@ export default {
DatePortion = fullYear + "-" + fullMonth + "-" + fullDay;
}
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(
this.date = window.$gz.translation.localTimeDateStringToUTC8601String(
DatePortion + "T" + value,
this.timeZoneName
);

View File

@@ -28,7 +28,7 @@ export default {
data() {
return {
formattedValue: this.value,
languageName: window.$gz.locale.getBrowserFirstLanguage()
languageName: window.$gz.translation.getBrowserFirstLanguage()
};
},
watch: {
@@ -48,10 +48,10 @@ export default {
},
methods: {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
return window.$gz.translation.get(ltKey);
},
locale() {
return window.$gz.locale;
translation() {
return window.$gz.translation;
},
handleInput(value) {
this.$emit(

View File

@@ -490,7 +490,7 @@ export default {
window.$gz.eventBus.$emit("openobject", { type: typeToOpen, id: i });
},
lt(ltKey) {
return window.$gz.locale.get(ltKey);
return window.$gz.translation.get(ltKey);
},
getDataFromApi() {
var vm = this;
@@ -534,8 +534,8 @@ export default {
(async function() {
//Save a copy of the server columns data for handling button clicks etc later
vm.serverColumns = res.columns;
//Make sure the locale keys are fetched
await fetchLocalizedHeaderNames(res.columns); //Note can use await here because it's wrapped inside an async function call, it will wait then resume next stuff below
//Make sure the translation keys are fetched
await fetchTranslatedHeaderNames(res.columns); //Note can use await here because it's wrapped inside an async function call, it will wait then resume next stuff below
await fetchEnums(res.columns);
//build vm.headers here
@@ -584,7 +584,7 @@ function buildHeaders(columnData) {
for (var i = 0; i < columnData.length; i++) {
var cm = columnData[i];
var h = {};
h.text = window.$gz.locale.get(cm.cm);
h.text = window.$gz.translation.get(cm.cm);
h.value = "columns.c" + i.toString(); //+".v";
ret.push(h);
}
@@ -594,7 +594,7 @@ function buildHeaders(columnData) {
//Called by getDataFromApi on retrieval of list with columnData
function buildRecords(listData, columndefinitions) {
//iterate data, build each object keyed with index name and display set to correct locale filter and then return
//iterate data, build each object keyed with index name and display set to correct translated filter and then return
var ret = [];
if (!listData) {
@@ -602,8 +602,8 @@ function buildRecords(listData, columndefinitions) {
}
//cache display format stuff
var timeZoneName = window.$gz.locale.getBrowserTimeZoneName();
var languageName = window.$gz.locale.getBrowserLanguages();
var timeZoneName = window.$gz.translation.getBrowserTimeZoneName();
var languageName = window.$gz.translation.getBrowserLanguages();
var hour12 = window.$gz.store.state.locale.hour12;
var currencyName = window.$gz.store.state.locale.currencyName;
@@ -640,7 +640,7 @@ function buildRecords(listData, columndefinitions) {
*/
switch (dataType) {
case 1: //datetime format to shortdatetime
display = window.$gz.locale.utcDateToShortDateAndTimeLocalized(
display = window.$gz.translation.utcDateToShortDateAndTimeLocalized(
display,
timeZoneName,
languageName,
@@ -648,14 +648,14 @@ function buildRecords(listData, columndefinitions) {
);
break;
case 2: //date only
display = window.$gz.locale.utcDateToShortDateLocalized(
display = window.$gz.translation.utcDateToShortDateLocalized(
display,
timeZoneName,
languageName
);
break;
case 3: //time only
display = window.$gz.locale.utcDateToShortTimeLocalized(
display = window.$gz.translation.utcDateToShortTimeLocalized(
display,
timeZoneName,
languageName,
@@ -663,10 +663,13 @@ function buildRecords(listData, columndefinitions) {
);
break;
case 7: //decimal
display = window.$gz.locale.decimalLocalized(display, languageName);
display = window.$gz.translation.decimalLocalized(
display,
languageName
);
break;
case 8: //currency
display = window.$gz.locale.currencyLocalized(
display = window.$gz.translation.currencyLocalized(
display,
languageName,
currencyName
@@ -717,9 +720,9 @@ function buildRecords(listData, columndefinitions) {
//////////////////////////////////////////////////////////
//
// Ensures column names are present in locale table
// Ensures column names are present in translation table
//
async function fetchLocalizedHeaderNames(columnData) {
async function fetchTranslatedHeaderNames(columnData) {
if (!columnData) {
return;
}
@@ -729,7 +732,7 @@ async function fetchLocalizedHeaderNames(columnData) {
headerKeys.push(cm.cm);
}
//Now fetch all the keys and await the response before returning
await window.$gz.locale.fetch(headerKeys).then(() => {
await window.$gz.translation.fetch(headerKeys).then(() => {
return;
});
}

View File

@@ -5,7 +5,7 @@
{{ currentNotification.message }}
</v-alert>
<v-btn text v-if="currentNotification.helpUrl" @click="helpClick()">
{{ this.$root.$gz.locale.get("More") }}
{{ this.$root.$gz.translation.get("More") }}
</v-btn>
</v-snackbar>
<!-- </v-scale-transition> -->

View File

@@ -103,7 +103,7 @@ export default {
methods: {
lt: function(ltkey) {
return window.$gz.locale.get(ltkey);
return window.$gz.translation.get(ltkey);
},
addTag() {
var theTag = this.tagSearchEntry;
@@ -127,8 +127,8 @@ export default {
if (!window.$gz._) {
throw "tag-picker: $gz._ (lodash) is required and missing";
}
if (!window.$gz.locale) {
throw "tag-picker: $gz.locale is required and missing";
if (!window.$gz.translation) {
throw "tag-picker: $gz.translation is required and missing";
}
}
}

View File

@@ -49,10 +49,12 @@ export default {
oldDate: null,
dlgtime: false,
//cache display format stuff
timeZoneName: window.$gz.locale.getBrowserTimeZoneName(),
languageName: window.$gz.locale.getBrowserLanguages(),
hour12: window.$gz.locale.getHour12(),
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0]
timeZoneName: window.$gz.translation.getBrowserTimeZoneName(),
languageName: window.$gz.translation.getBrowserLanguages(),
hour12: window.$gz.translation.getHour12(),
defaultLocale: window.$gz.translation
.getBrowserFirstLanguage()
.split("-", 1)[0]
}),
props: {
label: String,
@@ -66,7 +68,7 @@ export default {
},
methods: {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
return window.$gz.translation.get(ltKey);
}
},
watch: {
@@ -89,7 +91,7 @@ export default {
},
computed: {
formatDateTime() {
return window.$gz.locale.utcDateToShortDateAndTimeLocalized(
return window.$gz.translation.utcDateToShortDateAndTimeLocalized(
this.value,
this.timeZoneName,
this.languageName,
@@ -97,7 +99,7 @@ export default {
);
},
formatTime() {
return window.$gz.locale.utcDateToShortTimeLocalized(
return window.$gz.translation.utcDateToShortTimeLocalized(
this.value,
this.timeZoneName,
this.languageName,
@@ -107,7 +109,7 @@ export default {
dateOnly: {
get() {
//return date only portion converted to local working time zone: YYYY-MM-DD
return window.$gz.locale.utcDateStringToLocal8601DateOnlyString(
return window.$gz.translation.utcDateStringToLocal8601DateOnlyString(
this.value,
this.timeZoneName
);
@@ -118,7 +120,7 @@ export default {
if (!TimePortion) {
TimePortion = "00:00:00";
}
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(
this.date = window.$gz.translation.localTimeDateStringToUTC8601String(
value + "T" + TimePortion,
this.timeZoneName
);
@@ -128,7 +130,7 @@ export default {
//expects just the hours minutes seconds portion: 18:18:49
//Needs to convert into and out of the desired time zone or the control will show the UTC time instead
get() {
return window.$gz.locale.utcDateStringToLocal8601TimeOnlyString(
return window.$gz.translation.utcDateStringToLocal8601TimeOnlyString(
this.value,
this.timeZoneName
);
@@ -150,7 +152,7 @@ export default {
DatePortion = fullYear + "-" + fullMonth + "-" + fullDay;
}
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(
this.date = window.$gz.translation.localTimeDateStringToUTC8601String(
DatePortion + "T" + value,
this.timeZoneName
);