From 26bdc47f6df50d76a6243909d932dc23c24ad9f8 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 11 Aug 2021 20:11:42 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 98 +++++++++++++++----------- 1 file changed, 55 insertions(+), 43 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index f14a850..ca69c6f 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -176,7 +176,7 @@ namespace AyaNova.PlugIn.V8 //this holds all objects set to use banking //so that as a final step the servicebank can iterate //it and migrate (objects need to exist first in v8) - // private Dictionary BankedObjects = new Dictionary(); + // private Dictionary BankedObjects = new Dictionary(); private Dictionary V7ToV8IdMap = new Dictionary(); @@ -279,7 +279,7 @@ namespace AyaNova.PlugIn.V8 V7ToV8IdMap.Clear(); V7ToV8WorkOrderItemStatusIdMap.Clear(); TagMap.Clear(); - // BankedObjects.Clear(); + // BankedObjects.Clear(); LocaleMap.Clear(); @@ -2483,7 +2483,7 @@ namespace AyaNova.PlugIn.V8 d.latitude = client.GoToAddress.Latitude; d.longitude = client.GoToAddress.Longitude; } - + if (c.uiHasSignature) { d.customerSignature = util.v7StrokePathTov8SVG(c.WorkorderService.Signature.StrokePath, c.WorkorderService.Signature.Width, c.WorkorderService.Signature.Height); @@ -3077,7 +3077,7 @@ namespace AyaNova.PlugIn.V8 progress.Op("Start Locales export"); progress.SubOp(""); progress.Append("Exporting customized Locales"); - + //Get a list of RAVEN translations and ID's var a = await util.GetAsync("translation/list"); @@ -3093,11 +3093,13 @@ namespace AyaNova.PlugIn.V8 LocalizedTextTable lt = LocalizedTextTable.Load(i.Locale); progress.Op("Checking if locale " + i.Locale + " is customized"); -//#if(DEBUG) -// //continue; -//#endif + //#if(DEBUG) + // //continue; + //#endif if (!util.LocaleIsCustomized(i.Locale, lt, progress)) continue; - + + //Guess the source language + var ProbableSourceLocale = GuessCustomLocaleSourceLanguage(lt); //collection to hold items sent to server List exportItems = new List(); @@ -3135,7 +3137,7 @@ namespace AyaNova.PlugIn.V8 //MAKE A DUPLICATE var exportName = GetUniqueName(i.Locale + " (" + RavenLocaleName + ")"); progress.SubOp(""); - progress.Op("Exporting " + i.Locale + " to " + exportName); + progress.Op("Exporting " + i.Locale + " to " + exportName); a = await util.PostAsync("translation/duplicate/" + x.ToString()); var targetTranslationId = util.IdFromResponse(a); @@ -3176,7 +3178,7 @@ namespace AyaNova.PlugIn.V8 if (!DuplicateAvoidanceList.Contains(v8key)) { DuplicateAvoidanceList.Add(v8key); } else continue; - + TranslationItem v8TransItem = trans.FirstOrDefault(m => m.Key == v8key); if (v8TransItem == null) @@ -3397,43 +3399,53 @@ namespace AyaNova.PlugIn.V8 -/* -GUESS SOURCE LANGUAGE -todo: detect source language of custom and only do that one, not all languages as now - if can find a key that users can't edit becuase it's not exposed or super unlikely to be changed as not in UI - or something along those lines (or maybe 3 or four) then compare to each language to find the source of this one if possible - and detect it - - Error.UnableToOpenEmailUrl - en:Unable to open email address - de:E-Mail-Adresse kann nicht geöffnet werden - es:No puede abrirse la dirección de e-mail - fr:Impossible d'ouvrir l'adresse e-mail + /* + GUESS SOURCE LANGUAGE + todo: detect source language of custom and only do that one, not all languages as now + if can find a key that users can't edit becuase it's not exposed or super unlikely to be changed as not in UI + or something along those lines (or maybe 3 or four) then compare to each language to find the source of this one if possible + and detect it - Global.Label.AllowScheduleConflicts - en:Allow Schedule Conflicts - de:Planungskonflikte zulassen - es:Permitir conflictos de programación - fr:Autoriser les conflits de programme + Error.UnableToOpenEmailUrl + en:Unable to open email address + de:E-Mail-Adresse kann nicht geöffnet werden + es:No puede abrirse la dirección de e-mail + fr:Impossible d'ouvrir l'adresse e-mail - ReportEditor.Label.Properties - en:Properties - de:Eigenschaften - es:Propiedades - fr:Propriétés + Global.Label.AllowScheduleConflicts + en:Allow Schedule Conflicts + de:Planungskonflikte zulassen + es:Permitir conflictos de programación + fr:Autoriser les conflits de programme - StopWords3 - en:would some what such make come while its use those see out who ll but get have same up well because between for all each does came just from was an these himself very under over more - de:hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt kann kannst können könnt machen mein meine mit muß mußt musst müssen müßt nach nachdem nein nicht nun oder seid sein seine sich - es:detras detrás dia día dias días donde dónde dos durante e el él ella ellas ellos en encima enfrente enseguida entre es esa ésa esas ésas ese ése eso esos ésos esta está ésta estado estados estan están estar estas éstas este éste esto estos éstos ex - fr:font foce haut hos ici il ils je juste la le les leu là ma maintenant mais mes mine moins mon mot même ni nommés note nous nouveaux ou où pa pace paole pas pesonnes peut peu pièce plupat pou pouquoi quand que quel + ReportEditor.Label.Properties + en:Properties + de:Eigenschaften + es:Propiedades + fr:Propriétés - UI.Help.TechSupport - en:Technical support - de:Technische Unterstützung - es:Asistencia técnica - fr:Assistance technique -*/ + StopWords3 + en:would some what such make come while its use those see out who ll but get have same up well because between for all each does came just from was an these himself very under over more + de:hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt kann kannst können könnt machen mein meine mit muß mußt musst müssen müßt nach nachdem nein nicht nun oder seid sein seine sich + es:detras detrás dia día dias días donde dónde dos durante e el él ella ellas ellos en encima enfrente enseguida entre es esa ésa esas ésas ese ése eso esos ésos esta está ésta estado estados estan están estar estas éstas este éste esto estos éstos ex + fr:font foce haut hos ici il ils je juste la le les leu là ma maintenant mais mes mine moins mon mot même ni nommés note nous nouveaux ou où pa pace paole pas pesonnes peut peu pièce plupat pou pouquoi quand que quel + + UI.Help.TechSupport + en:Technical support + de:Technische Unterstützung + es:Asistencia técnica + fr:Assistance technique + */ + + public string GuessCustomLocaleSourceLanguage(LocaleText lt) + { + int en = 0; + int de = 0; + int fr = 0; + int es = 0; + + + } #endregion locale utility