renamed lt function to t as it's no longer localized text and t is shorter, also renamed parameter ltKey to tKey for similar reasons

This commit is contained in:
2020-03-27 19:45:37 +00:00
parent cb21d9ece9
commit e548ecb12f
18 changed files with 222 additions and 223 deletions

View File

@@ -39,7 +39,7 @@
clearable
@click:clear="fieldValueChanged('name')"
:counter="255"
:label="lt('Name')"
:label="t('Name')"
:rules="[
form().max255(this, 'name'),
form().required(this, 'name')
@@ -53,7 +53,7 @@
<v-checkbox
v-model="obj.public"
:readonly="this.formState.readOnly"
:label="lt('AnyUser')"
:label="t('AnyUser')"
ref="public"
@change="fieldValueChanged('public')"
></v-checkbox>
@@ -72,7 +72,7 @@
<v-switch
v-if="!item.rid"
v-model="item.include"
:label="lt('Include')"
:label="t('Include')"
:ref="item.key"
:disabled="
item.sort != null || item.filter.items.length > 0
@@ -80,7 +80,7 @@
@change="includeChanged(item)"
></v-switch>
<div v-if="item.rid" class="v-label mb-8 mt-6">
{{ lt("Include") }}
{{ t("Include") }}
</div>
<!-- RE-ORDER CONTROL -->
<div class="d-flex justify-space-between">
@@ -120,7 +120,7 @@
></v-btn
>
<label class="v-label theme--light"
>&nbsp;{{ lt("Sort") }}</label
>&nbsp;{{ t("Sort") }}</label
>
</div>
</template>
@@ -136,7 +136,7 @@
:items="selectLists.dateFilterTokens"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
<div v-if="item.tempFilterToken == '*select*'">
@@ -176,7 +176,7 @@
:items="selectLists.stringFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
<v-text-field
@@ -204,7 +204,7 @@
:items="selectLists.integerFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
<v-text-field
@@ -232,7 +232,7 @@
:items="selectLists.boolFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
<v-radio-group
@@ -245,13 +245,10 @@
row
>
<v-radio
:label="lt('False')"
:label="t('False')"
:value="false"
></v-radio>
<v-radio
:label="lt('True')"
:value="true"
></v-radio>
<v-radio :label="t('True')" :value="true"></v-radio>
</v-radio-group>
<v-btn
@@ -270,7 +267,7 @@
:items="selectLists.decimalFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
<gz-decimal
@@ -297,7 +294,7 @@
:items="selectLists.decimalFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
<gz-currency
@@ -324,7 +321,7 @@
:items="selectLists.tagFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
@@ -348,7 +345,7 @@
:items="selectLists.enumFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
:label="t('Filter')"
prepend-icon="fa-filter"
></v-select>
@@ -382,11 +379,11 @@
<!-- AND / OR FILTER CONDITIONS -->
<v-radio-group v-model="item.filter.any" row>
<v-radio
:label="lt('GridFilterDialogAndRadioText')"
:label="t('GridFilterDialogAndRadioText')"
:value="false"
></v-radio>
<v-radio
:label="lt('GridFilterDialogOrRadioText')"
:label="t('GridFilterDialogOrRadioText')"
:value="true"
></v-radio> </v-radio-group
></v-subheader>
@@ -558,7 +555,7 @@ export default {
}
},
methods: {
lt: function(ltkey) {
t: function(ltkey) {
return window.$gz.translation.get(ltkey);
},
enumSelectionList: function(enumKey) {
@@ -704,7 +701,7 @@ export default {
// //switch to unsaved listview if not already
// if (this.listViewId != -1) {
// this.listViewId = -1;
// vm.obj.name = vm.lt("FilterUnsaved");
// vm.obj.name = vm.t("FilterUnsaved");
// }
// },
fieldValueChanged(ref) {
@@ -717,7 +714,7 @@ export default {
var vm = this;
//check that "unsaved filter" is not the name
//if it is, set it empty and force user to set a name
if (vm.obj.name == vm.lt("FilterUnsaved")) {
if (vm.obj.name == vm.t("FilterUnsaved")) {
vm.obj.name = "";
return;
}
@@ -1052,143 +1049,143 @@ function fetchTranslatedText(vm) {
function populateSelectionLists(vm) {
vm.selectLists.dateFilterOperators.push(
...[
{ name: vm.lt("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{ name: vm.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.lt("GridRowFilterDropDownNonBlanksItem"),
name: vm.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.lt("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.lt("GridRowFilterDropDownGreaterThan"), id: ">" },
{ name: vm.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.lt("GridRowFilterDropDownGreaterThanOrEqualTo"),
name: vm.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.lt("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.lt("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.lt("GridRowFilterDropDownNotEquals"), id: "!=" }
{ name: vm.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
vm.selectLists.dateFilterTokens.push(
...[
{ name: "(" + vm.lt("SelectItem") + ")", id: "*select*" }, //If select then use entry in date /time picker
{ name: vm.lt("DateRangeYesterday"), id: "*yesterday*" },
{ name: vm.lt("DateRangeToday"), id: "*today*" },
{ name: vm.lt("DateRangeTomorrow"), id: "*tomorrow*" },
{ name: vm.lt("DateRangeLastWeek"), id: "*lastweek*" },
{ name: vm.lt("DateRangeThisWeek"), id: "*thisweek*" },
{ name: vm.lt("DateRangeNextWeek"), id: "*nextweek*" },
{ name: vm.lt("DateRangeLastMonth"), id: "*lastmonth*" },
{ name: vm.lt("DateRangeThisMonth"), id: "*thismonth*" },
{ name: vm.lt("DateRangeNextMonth"), id: "*nextmonth*" },
{ name: vm.lt("DateRange14DayWindow"), id: "*14daywindow*" },
{ name: vm.lt("DateRangePast"), id: "*past*" },
{ name: vm.lt("DateRangeFuture"), id: "*future*" },
{ name: vm.lt("DateRangeLastYear"), id: "*lastyear*" }, //prior year from jan to dec
{ name: vm.lt("DateRangeThisYear"), id: "*thisyear*" },
{ name: "(" + vm.t("SelectItem") + ")", id: "*select*" }, //If select then use entry in date /time picker
{ name: vm.t("DateRangeYesterday"), id: "*yesterday*" },
{ name: vm.t("DateRangeToday"), id: "*today*" },
{ name: vm.t("DateRangeTomorrow"), id: "*tomorrow*" },
{ name: vm.t("DateRangeLastWeek"), id: "*lastweek*" },
{ name: vm.t("DateRangeThisWeek"), id: "*thisweek*" },
{ name: vm.t("DateRangeNextWeek"), id: "*nextweek*" },
{ name: vm.t("DateRangeLastMonth"), id: "*lastmonth*" },
{ name: vm.t("DateRangeThisMonth"), id: "*thismonth*" },
{ name: vm.t("DateRangeNextMonth"), id: "*nextmonth*" },
{ name: vm.t("DateRange14DayWindow"), id: "*14daywindow*" },
{ name: vm.t("DateRangePast"), id: "*past*" },
{ name: vm.t("DateRangeFuture"), id: "*future*" },
{ name: vm.t("DateRangeLastYear"), id: "*lastyear*" }, //prior year from jan to dec
{ name: vm.t("DateRangeThisYear"), id: "*thisyear*" },
{
name: vm.lt("DateRangeInTheLastThreeMonths"),
name: vm.t("DateRangeInTheLastThreeMonths"),
id: "*last3months*"
},
{
name: vm.lt("DateRangeInTheLastSixMonths"),
name: vm.t("DateRangeInTheLastSixMonths"),
id: "*last6months*"
},
{ name: vm.lt("DateRangePastYear"), id: "*pastyear*" }, //last 365 days
{ name: vm.t("DateRangePastYear"), id: "*pastyear*" }, //last 365 days
{ name: vm.lt("DateRangePast90Days"), id: "*past90days*" },
{ name: vm.lt("DateRangePast30Days"), id: "*past30days*" },
{ name: vm.lt("DateRangePast24Hours"), id: "*past24hours*" }
{ name: vm.t("DateRangePast90Days"), id: "*past90days*" },
{ name: vm.t("DateRangePast30Days"), id: "*past30days*" },
{ name: vm.t("DateRangePast24Hours"), id: "*past24hours*" }
]
);
vm.selectLists.stringFilterOperators.push(
...[
{ name: vm.lt("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{ name: vm.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.lt("GridRowFilterDropDownNonBlanksItem"),
name: vm.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.lt("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.lt("GridRowFilterDropDownGreaterThan"), id: ">" },
{ name: vm.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.lt("GridRowFilterDropDownGreaterThanOrEqualTo"),
name: vm.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.lt("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.lt("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.lt("GridRowFilterDropDownNotEquals"), id: "!=" },
{ name: vm.lt("GridRowFilterDropDownDoesNotContain"), id: "!-%-" },
{ name: vm.lt("GridRowFilterDropDownContains"), id: "-%-" },
{ name: vm.lt("GridRowFilterDropDownStartsWith"), id: "%-" },
{ name: vm.lt("GridRowFilterDropDownEndsWith"), id: "-%" }
{ name: vm.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.t("GridRowFilterDropDownNotEquals"), id: "!=" },
{ name: vm.t("GridRowFilterDropDownDoesNotContain"), id: "!-%-" },
{ name: vm.t("GridRowFilterDropDownContains"), id: "-%-" },
{ name: vm.t("GridRowFilterDropDownStartsWith"), id: "%-" },
{ name: vm.t("GridRowFilterDropDownEndsWith"), id: "-%" }
]
);
vm.selectLists.integerFilterOperators.push(
...[
{ name: vm.lt("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{ name: vm.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.lt("GridRowFilterDropDownNonBlanksItem"),
name: vm.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.lt("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.lt("GridRowFilterDropDownGreaterThan"), id: ">" },
{ name: vm.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.lt("GridRowFilterDropDownGreaterThanOrEqualTo"),
name: vm.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.lt("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.lt("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.lt("GridRowFilterDropDownNotEquals"), id: "!=" }
{ name: vm.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
vm.selectLists.boolFilterOperators.push(
...[
{ name: vm.lt("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{ name: vm.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.lt("GridRowFilterDropDownNonBlanksItem"),
name: vm.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.lt("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.lt("GridRowFilterDropDownNotEquals"), id: "!=" }
{ name: vm.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
vm.selectLists.decimalFilterOperators.push(
...[
{ name: vm.lt("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{ name: vm.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.lt("GridRowFilterDropDownNonBlanksItem"),
name: vm.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.lt("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.lt("GridRowFilterDropDownGreaterThan"), id: ">" },
{ name: vm.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.lt("GridRowFilterDropDownGreaterThanOrEqualTo"),
name: vm.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.lt("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.lt("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.lt("GridRowFilterDropDownNotEquals"), id: "!=" }
{ name: vm.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
//tags filter only by equals in initial release, see DataListSqlFilterCriteriaBuilder.cs line 523 for deets
vm.selectLists.tagFilterOperators.push({
name: vm.lt("GridRowFilterDropDownEquals"),
name: vm.t("GridRowFilterDropDownEquals"),
id: "="
});
vm.selectLists.enumFilterOperators.push(
...[
{ name: vm.lt("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{ name: vm.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.lt("GridRowFilterDropDownNonBlanksItem"),
name: vm.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.lt("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.lt("GridRowFilterDropDownNotEquals"), id: "!=" }
{ name: vm.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
}
@@ -1216,7 +1213,7 @@ function fetchTranslatedFieldNames(vm) {
var columnKeys = [];
for (var i = 1; i < vm.fieldDefinitions.length; i++) {
var cm = vm.fieldDefinitions[i];
columnKeys.push(cm.ltKey);
columnKeys.push(cm.tKey);
}
//Now fetch all the keys and await the response before returning
return window.$gz.translation.fetch(columnKeys).then(() => {
@@ -1248,7 +1245,7 @@ function setEffectiveListView(vm) {
vm.effectiveListView = JSON.parse(
formSettings.saved.dataTable.unsavedListView
);
vm.obj.name = vm.lt("FilterUnsaved");
vm.obj.name = vm.t("FilterUnsaved");
return Promise.resolve();
}
} else if (vm.listViewId == 0) {
@@ -1261,7 +1258,7 @@ function setEffectiveListView(vm) {
throw res.error;
} else {
vm.effectiveListView = JSON.parse(res.data);
vm.obj.name = vm.lt("FilterUnsaved");
vm.obj.name = vm.t("FilterUnsaved");
}
});
} else {
@@ -1299,7 +1296,7 @@ function initDataObject(vm) {
var fld = window.$gz._.find(vm.fieldDefinitions, ["fieldKey", lvItem.fld]);
var o = {
key: fld.fieldKey,
title: vm.lt(fld.ltKey),
title: vm.t(fld.tKey),
include: true,
isFilterable: fld.isFilterable,
isSortable: fld.isSortable,
@@ -1347,7 +1344,7 @@ function initDataObject(vm) {
//nope, so add it
var o = {
key: fld.fieldKey,
title: vm.lt(fld.ltKey),
title: vm.t(fld.tKey),
include: false,
isFilterable: fld.isFilterable,
isSortable: fld.isSortable,
@@ -1474,8 +1471,8 @@ function getDisplayForFilter(
break;
case 6: //BOOL translate
//debugger;
var ltKey = filterValue ? "True" : "False";
valueDisplay = vm.lt(ltKey);
var tKey = filterValue ? "True" : "False";
valueDisplay = vm.t(tKey);
break;
case 10: //ENUM translate
valueDisplay = window.$gz.enums.get(enumType, filterValue);