This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<v-app>
|
||||
<gznotify ref="gznotify"></gznotify>
|
||||
<gzconfirm ref="gzconfirm"></gzconfirm>
|
||||
<!-- Width of nav drawer set to allow widest localized text menu item to show which is spanish client service requests item -->
|
||||
<!-- Width of nav drawer set to allow widest translated text menu item to show which is spanish client service requests item -->
|
||||
<v-navigation-drawer
|
||||
v-if="isAuthenticated"
|
||||
v-model="drawer"
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
AyaNova7Import: 10,
|
||||
TrialSeeder: 11,
|
||||
Metrics: 12,
|
||||
Locale: 13,
|
||||
Translation: 13,
|
||||
UserOptions: 14,
|
||||
DEPRECATED_REUSELATER_15: 15,
|
||||
DEPRECATED_REUSELATER_16: 16,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
var rights = JSON.parse(
|
||||
'{"User":{"Change":2,"ReadFullRecord":1},"UserOptions":{"Change":2,"ReadFullRecord":1},"Widget":{"Change":34,"ReadFullRecord":17},"ServerState":{"Change":16384,"ReadFullRecord":131071},"License":{"Change":16386,"ReadFullRecord":8193},"LogFile":{"Change":0,"ReadFullRecord":24576},"JobOperations":{"Change":16384,"ReadFullRecord":8195},"AyaNova7Import":{"Change":16384,"ReadFullRecord":0},"Metrics":{"Change":0,"ReadFullRecord":24576},"Locale":{"Change":16386,"ReadFullRecord":131071},"DataListView":{"Change":2,"ReadFullRecord":131071},"DataListTemplate":{"Change":2,"ReadFullRecord":131071},"FormCustom":{"Change":2,"ReadFullRecord":131071}}'
|
||||
//'{"User":{"Change":2,"ReadFullRecord":1},"UserOptions":{"Change":2,"ReadFullRecord":1},"Widget":{"Change":34,"ReadFullRecord":17},"ServerState":{"Change":16384,"ReadFullRecord":131071},"License":{"Change":16386,"ReadFullRecord":8193},"LogFile":{"Change":0,"ReadFullRecord":24576},"JobOperations":{"Change":16384,"ReadFullRecord":8195},"AyaNova7Import":{"Change":16384,"ReadFullRecord":0},"Metrics":{"Change":0,"ReadFullRecord":24576},"Locale":{"Change":16386,"ReadFullRecord":131071},"DataListFilter":{"Change":2,"ReadFullRecord":131071},"DataListTemplate":{"Change":2,"ReadFullRecord":131071},"FormCustom":{"Change":2,"ReadFullRecord":131071}}'
|
||||
'{"User":{"Change":2,"ReadFullRecord":1},"UserOptions":{"Change":2,"ReadFullRecord":1},"Widget":{"Change":34,"ReadFullRecord":17},"ServerState":{"Change":16384,"ReadFullRecord":131071},"License":{"Change":16386,"ReadFullRecord":8193},"LogFile":{"Change":0,"ReadFullRecord":24576},"JobOperations":{"Change":16384,"ReadFullRecord":8195},"AyaNova7Import":{"Change":16384,"ReadFullRecord":0},"Metrics":{"Change":0,"ReadFullRecord":24576},"Translation":{"Change":16386,"ReadFullRecord":131071},"DataListView":{"Change":2,"ReadFullRecord":131071},"DataListTemplate":{"Change":2,"ReadFullRecord":131071},"FormCustom":{"Change":2,"ReadFullRecord":131071}}'
|
||||
//'{"User":{"Change":2,"ReadFullRecord":1},"UserOptions":{"Change":2,"ReadFullRecord":1},"Widget":{"Change":34,"ReadFullRecord":17},"ServerState":{"Change":16384,"ReadFullRecord":131071},"License":{"Change":16386,"ReadFullRecord":8193},"LogFile":{"Change":0,"ReadFullRecord":24576},"JobOperations":{"Change":16384,"ReadFullRecord":8195},"AyaNova7Import":{"Change":16384,"ReadFullRecord":0},"Metrics":{"Change":0,"ReadFullRecord":24576},"Translation":{"Change":16386,"ReadFullRecord":131071},"DataListFilter":{"Change":2,"ReadFullRecord":131071},"DataListTemplate":{"Change":2,"ReadFullRecord":131071},"FormCustom":{"Change":2,"ReadFullRecord":131071}}'
|
||||
);
|
||||
export default rights;
|
||||
|
||||
@@ -5,8 +5,8 @@ var lastMessageHash = 0;
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// Localize, Log and optionally display errors
|
||||
// return localized message in case caller needs it
|
||||
// translate, Log and optionally display errors
|
||||
// return translated message in case caller needs it
|
||||
function dealWithError(msg, vm) {
|
||||
//Check if this is the same message again as last time to avoid
|
||||
//repetitive loops of useless messages
|
||||
@@ -16,10 +16,10 @@ function dealWithError(msg, vm) {
|
||||
}
|
||||
lastMessageHash = newHash;
|
||||
|
||||
//localize as necessary
|
||||
//translate as necessary
|
||||
msg = window.$gz.translation.translateString(msg);
|
||||
|
||||
//In some cases the error may not be localizable, if this is not a debug run then it should show without the ?? that localizing puts in keys not found
|
||||
//In some cases the error may not be translatable, if this is not a debug run then it should show without the ?? that translating puts in keys not found
|
||||
//so it's not as weird looking to the user
|
||||
if (!devModeShowErrors && msg.includes("??")) {
|
||||
msg = msg.replace("??", "");
|
||||
@@ -103,11 +103,11 @@ export default {
|
||||
dealWithError(msg);
|
||||
},
|
||||
/////////////////////////////////////////////////
|
||||
// Localize, log and return error
|
||||
// translate, log and return error
|
||||
//
|
||||
handleFormError(err, vm) {
|
||||
//called inside forms when things go unexpectedly wrong
|
||||
//returns the localized message in case the form wants to display it as well
|
||||
//returns the translated message in case the form wants to display it as well
|
||||
if (err instanceof Error && err.message) {
|
||||
dealWithError(err.message, vm);
|
||||
} else {
|
||||
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
}
|
||||
|
||||
if (value.length > max) {
|
||||
//get the localized rule text
|
||||
//get the translated rule text
|
||||
// "ErrorFieldLengthExceeded": "{0} can not exceed {1} characters.",
|
||||
var err = window.$gz.translation.get("ErrorFieldLengthExceeded");
|
||||
var fieldName = getControlLabel(ctrl);
|
||||
|
||||
@@ -16,7 +16,7 @@ function addNavItem(title, icon, route, navItems, key) {
|
||||
export default function initialize() {
|
||||
var promise = new Promise(function(resolve) {
|
||||
if (window.$gz.store.state.authenticated) {
|
||||
//Fetch the core localized text keys that will always be required by user
|
||||
//Fetch the core translated text keys that will always be required by user
|
||||
window.$gz.translation
|
||||
.fetch(window.$gz.translation.coreKeys)
|
||||
.then(function initializeNavPanel() {
|
||||
@@ -110,9 +110,9 @@ export default function initialize() {
|
||||
});
|
||||
|
||||
//Moved these two into user settings
|
||||
// //USER LOCALE
|
||||
// //USER TRANSLATE
|
||||
// sub.push({
|
||||
// title: window.$gz.translation.get("Locale"),
|
||||
// title: window.$gz.translation.get("Translation"),
|
||||
// icon: "language",
|
||||
// route: "/home-translation",
|
||||
// key: key++
|
||||
@@ -560,7 +560,7 @@ export default function initialize() {
|
||||
sub.push({
|
||||
title: window.$gz.translation.get("Translation"),
|
||||
icon: "language",
|
||||
route: "/adm-localized-text",
|
||||
route: "/adm-translation",
|
||||
key: key++
|
||||
});
|
||||
|
||||
@@ -735,7 +735,7 @@ export default function initialize() {
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
//CACHE LOCALE SETTINGS
|
||||
//CACHE TRANSLATION SETTINGS
|
||||
window.$gz.api
|
||||
.get("UserOptions/" + window.$gz.store.state.userId)
|
||||
.then(res => {
|
||||
|
||||
@@ -9,7 +9,7 @@ export default {
|
||||
return window.$gz.store.state.translationText[key];
|
||||
},
|
||||
fetch(keys) {
|
||||
return new Promise(function fetchLocaleKeysFromServer(resolve) {
|
||||
return new Promise(function fetchTranslationKeysFromServer(resolve) {
|
||||
//
|
||||
//step 1: build an array of keys that we don't have already
|
||||
//Note: this will ensure only unique keys go into the store so it's safe to call this with dupes as can happen
|
||||
@@ -55,7 +55,6 @@ export default {
|
||||
"Schedule",
|
||||
"MemoList",
|
||||
"UserSettings",
|
||||
"Locale",
|
||||
"SetLoginPassword",
|
||||
"NotifySubscriptionList",
|
||||
"UserPreferences",
|
||||
@@ -408,12 +407,11 @@ export default {
|
||||
},
|
||||
////////////////////////////////////////////////////////
|
||||
// dynamically set the vuetify language elements from
|
||||
// users localized text (am/pm etc)
|
||||
// users translated text
|
||||
// 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");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -291,10 +291,10 @@ export default new Router({
|
||||
},
|
||||
|
||||
{
|
||||
path: "/adm-localized-text",
|
||||
name: "adm-localized-text",
|
||||
path: "/adm-translation",
|
||||
name: "adm-translation",
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "adm" */ "./views/adm-localized-text.vue")
|
||||
import(/* webpackChunkName: "adm" */ "./views/adm-translation.vue")
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ export default new Vuex.Store({
|
||||
userType: 0,
|
||||
homePage: undefined,
|
||||
translationText: {},
|
||||
enums: {}, //all enum values with localized text to match stored as key e.g. enums:={AuthorizationRoles:{0:"no role",1:"Limited role"},UserTypes:{0:"Technician",1:"Client user"}}
|
||||
enums: {}, //all enum values with translated text to match stored as key e.g. enums:={AuthorizationRoles:{0:"no role",1:"Limited role"},UserTypes:{0:"Technician",1:"Client user"}}
|
||||
locale: {
|
||||
languageOverride: "en-US",
|
||||
timeZoneOverride: "America/New_York",
|
||||
|
||||
@@ -246,7 +246,7 @@ function initForm(vm) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
(async function() {
|
||||
try {
|
||||
await fetchUILocalizedText(vm);
|
||||
await fetchTranslatedText(vm);
|
||||
await getServerInfo(vm);
|
||||
await getBrowserInfo(vm);
|
||||
} catch (err) {
|
||||
@@ -259,9 +259,9 @@ function initForm(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI localized text is available
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
function fetchUILocalizedText(vm) {
|
||||
function fetchTranslatedText(vm) {
|
||||
var ltKeysRequired = [
|
||||
"HelpAboutAyaNova",
|
||||
"ClientApp",
|
||||
|
||||
@@ -322,7 +322,7 @@ function generateMenu(vm) {
|
||||
menuOptions.menuItems.push({
|
||||
title: window.$gz.translation.get("Translation"),
|
||||
icon: "language",
|
||||
data: "adm-localized-text",
|
||||
data: "adm-translation",
|
||||
key: "app:nav"
|
||||
});
|
||||
|
||||
@@ -336,7 +336,7 @@ function initForm(vm) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
(async function() {
|
||||
try {
|
||||
await fetchUILocalizedText(vm);
|
||||
await fetchTranslatedText(vm);
|
||||
await populatePickLists(vm);
|
||||
await ensureTemplateIsInStore(vm);
|
||||
await initDataObject(vm);
|
||||
@@ -350,9 +350,9 @@ function initForm(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI localized text is available
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
function fetchUILocalizedText(vm) {
|
||||
function fetchTranslatedText(vm) {
|
||||
var ltKeysRequired = [
|
||||
"FormFieldEntryRequired",
|
||||
"FormFieldVisible",
|
||||
|
||||
@@ -976,7 +976,7 @@ function initForm(vm) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
(async function() {
|
||||
try {
|
||||
await fetchUILocalizedText(vm);
|
||||
await fetchTranslatedText(vm);
|
||||
await populatePickLists(vm);
|
||||
await populateFieldDefinitions(vm);
|
||||
await fetchTranslatedFieldNames(vm);
|
||||
@@ -993,9 +993,9 @@ function initForm(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI localized text is available
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
function fetchUILocalizedText(vm) {
|
||||
function fetchTranslatedText(vm) {
|
||||
var ltKeysRequired = [
|
||||
"DataListView",
|
||||
"GridFilterName",
|
||||
@@ -1386,7 +1386,7 @@ function initDataObject(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures localized enum lists are available pre-cached
|
||||
// Ensures translated enum lists are available pre-cached
|
||||
//
|
||||
function fetchEnums(vm) {
|
||||
//build an array of all enums then execute method
|
||||
@@ -1418,7 +1418,7 @@ function updateEditedListView(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Convert filter properties to localized / displayable
|
||||
// Convert filter properties to translated / displayable
|
||||
// used when making new filter and loading existing
|
||||
//
|
||||
function getDisplayForFilter(
|
||||
@@ -1461,23 +1461,23 @@ function getDisplayForFilter(
|
||||
|
||||
var valueDisplay = "selected value";
|
||||
switch (uiFieldDataType) {
|
||||
case 1: //date localize
|
||||
case 1: //date translate
|
||||
valueDisplay = window.$gz.translation.utcDateToShortDateAndTimeLocalized(
|
||||
filterValue
|
||||
);
|
||||
break;
|
||||
case 8: //currency localize
|
||||
case 8: //currency translate
|
||||
valueDisplay = window.$gz.translation.currencyLocalized(filterValue);
|
||||
break;
|
||||
case 7: //decimal localize
|
||||
case 7: //decimal translate
|
||||
valueDisplay = window.$gz.translation.decimalLocalized(filterValue);
|
||||
break;
|
||||
case 6: //BOOL localize
|
||||
case 6: //BOOL translate
|
||||
//debugger;
|
||||
var ltKey = filterValue ? "True" : "False";
|
||||
valueDisplay = vm.lt(ltKey);
|
||||
break;
|
||||
case 10: //ENUM localize
|
||||
case 10: //ENUM translate
|
||||
valueDisplay = window.$gz.enums.get(enumType, filterValue);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -291,7 +291,7 @@ function initForm(vm) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
(async function() {
|
||||
try {
|
||||
await fetchUILocalizedText(vm);
|
||||
await fetchTranslatedText(vm);
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
@@ -302,9 +302,9 @@ function initForm(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI localized text is available
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
function fetchUILocalizedText(vm) {
|
||||
function fetchTranslatedText(vm) {
|
||||
return window.$gz.translation.fetch([
|
||||
"UserLogin",
|
||||
"OldPassword",
|
||||
|
||||
@@ -13,8 +13,8 @@ export default {
|
||||
window.$gz.eventBus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "language",
|
||||
title: window.$gz.translation.get("Locale"),
|
||||
helpUrl: "form-home-locale"
|
||||
title: window.$gz.translation.get("Translation"),
|
||||
helpUrl: "form-home-translation"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -393,7 +393,7 @@ function initForm(vm) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
(async function() {
|
||||
try {
|
||||
await fetchUILocalizedText(vm);
|
||||
await fetchTranslatedText(vm);
|
||||
// await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||
// await populatePickLists(vm);
|
||||
} catch (err) {
|
||||
@@ -406,9 +406,9 @@ function initForm(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI localized text is available
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
function fetchUILocalizedText(vm) {
|
||||
function fetchTranslatedText(vm) {
|
||||
return window.$gz.translation.fetch([
|
||||
"CurrencyCode",
|
||||
"LanguageCode",
|
||||
|
||||
@@ -33,16 +33,16 @@ export default {
|
||||
) {
|
||||
this.msg = '404 - NOT FOUND: "' + badPath + '"';
|
||||
} else {
|
||||
var notFoundLocalized = window.$gz.translation.get("ErrorAPI2010");
|
||||
var notFoundTranslated = window.$gz.translation.get("ErrorAPI2010");
|
||||
//format the message
|
||||
this.msg = "404 - " + notFoundLocalized + ': "' + badPath + '"';
|
||||
this.msg = "404 - " + notFoundTranslated + ': "' + badPath + '"';
|
||||
//log it in case we need to see it in tech support
|
||||
window.$gz.store.commit("logItem", this.msg);
|
||||
//set the title of the window
|
||||
window.$gz.eventBus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-dragon",
|
||||
title: "404 - " + notFoundLocalized
|
||||
title: "404 - " + notFoundTranslated
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ function initForm(vm) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
(async function() {
|
||||
try {
|
||||
await fetchUILocalizedText(vm);
|
||||
await fetchTranslatedText(vm);
|
||||
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||
await populatePickLists(vm);
|
||||
} catch (err) {
|
||||
@@ -665,9 +665,9 @@ function initForm(vm) {
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI localized text is available
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
function fetchUILocalizedText(vm) {
|
||||
function fetchTranslatedText(vm) {
|
||||
return window.$gz.translation.fetch([
|
||||
"Widget",
|
||||
"WidgetName",
|
||||
|
||||
Reference in New Issue
Block a user