From 5395e628b2d8658eecd87aab32f18265c257f803 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 19 Mar 2021 19:17:41 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 5 ++++- ayanova/src/api/locale.js | 28 ++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index f63465c1..029c8853 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -70,6 +70,7 @@ How will the user know what "language code" to enter - gives only one example "e [this is intended as an override for what their browser defaults to already which should be correct 99.99% of the time and should almost never need to be changed. Maybe I could include a link to the codes on a wikipedia page or something, they change from time to time and it wouldn't bre practical to include a list preset] ****yes a tooltip or URL link next to/under the label or the entry field would help by leading users to that info (in the URL) if they need. ****I'd also like to suggest "Override language code" as the label, to indicate that it OVERRIDES something existing. +https://www.w3.org/International/questions/qa-choosing-language-tags (italic is mine original message, your original response in []. The **** is my reply to yours) How will the user know what "Time zone" to enter - gives only one example "America/Vancouver" but when start typing in, nothing comes up to select? @@ -77,6 +78,8 @@ How will the user know what "Time zone" to enter - gives only one example "Ameri ****yes a tooltip or URL link next to/under the label or the entry field would help by leading users to that info (in the URL) if they need. ****I'd also like to suggest "Override Time Zone" as the label, to indicate that it OVERRIDES something existing. +https://wikipedia.org/wiki/List_of_tz_database_time_zones + (italic is mine original message, your original response in []. The **** is my reply to yours) I see "under" the "Map URL template" dropdown list where can select Google, Bing etc. Is the idea that a user will "know" what this is used for if they use it? [yes, if they have a particular mapping site they prefer they can select it here otherwise defaults to google maps.] @@ -155,7 +158,7 @@ Taxes won't let me change the existing Active status if previously selected on a ................................................................................................................................................................... - +todo: anywhere set LOGIN name, put a hint to use email address strongly recommended todo: reportClientMetaData in gzapi has DefaultLocale property in it which is just part of the language, can it be removed? it might be buggy if there is no dash in the language? Is that a thing? check at server how it's used diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index 4cf8a037..0287c28b 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -22,12 +22,18 @@ export default { // Get users default language code // first check if overriden in useroptions // if not then use browsers own setting + //if not that then final default of en-US getResolvedLanguage() { - let ov = window.$gz.store.state.userOptions.languageOverride; - if (!window.$gz.util.stringIsNullOrEmpty(ov)) { - return window.$gz.store.state.userOptions.languageOverride; + let l = window.$gz.store.state.userOptions.languageOverride; + if (!window.$gz.util.stringIsNullOrEmpty(l)) { + return l; } else { - return window.navigator.languages[0]; + l = window.navigator.languages[0]; + if (!window.$gz.util.stringIsNullOrEmpty(l)) { + return l; + } else { + return "en-US"; + } } }, @@ -35,14 +41,20 @@ export default { // Get users default time zone // first check if overriden in useroptions // if not then use browsers own setting + // if that is empty then final default of "America/New_York" //https://www.iana.org/time-zones //https://en.wikipedia.org/wiki/List_of_tz_database_time_zones getResolvedTimeZoneName() { - let ov = window.$gz.store.state.userOptions.timeZoneOverride; - if (!window.$gz.util.stringIsNullOrEmpty(ov)) { - return window.$gz.store.state.userOptions.timeZoneOverride; + let tz = window.$gz.store.state.userOptions.timeZoneOverride; + if (!window.$gz.util.stringIsNullOrEmpty(tz)) { + return tz; } else { - return Intl.DateTimeFormat().resolvedOptions().timeZone; + tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + if (!window.$gz.util.stringIsNullOrEmpty(tz)) { + return tz; + } else { + return "America/New_York"; + } } }, //////////////////////////////////////////////////