From 2652821bbfd22a668b401b674159fc4d1f35b911 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 11 Aug 2021 19:11:59 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 63 +++----------------------- 1 file changed, 7 insertions(+), 56 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 6d64983..21a3ea9 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -3077,30 +3077,7 @@ namespace AyaNova.PlugIn.V8 progress.Op("Start Locales export"); progress.SubOp(""); progress.Append("Exporting customized Locales"); - ////checksum locales - ////if a recognized checksum then don't import because it means it wasn't modified from stock - ///* - // Stock fresh trial db (fb) values: - // Locale Custom English [signature: -1965948581] - // Locale Deutsch [signature: -564065723] - // Locale English [signature: -1965948581] - // Locale Español [signature: -1122936791] - // Locale Français [signature: -679171126] - - //Do not use these keys in hash calculation which were added / modified during various schema updates - // Global.Label.UseInventory.Description - // Locale.Label.LocaleFile - // UnitNameDisplayFormats.Label.ModelSerial - // UnitNameDisplayFormats.Label.SerialModel - // UnitNameDisplayFormats.Label.SerialModelVendor - // UnitNameDisplayFormats.Label.VendorModelSerial - // O.PartBin - //*/ - //List StockLocaleHashes = new List(); - //StockLocaleHashes.Add(-1965948581); - //StockLocaleHashes.Add(-564065723); - //StockLocaleHashes.Add(-1122936791); - //StockLocaleHashes.Add(-679171126); + //Get a list of RAVEN translations and ID's var a = await util.GetAsync("translation/list"); @@ -3120,24 +3097,7 @@ namespace AyaNova.PlugIn.V8 // //continue; //#endif if (!util.LocaleIsCustomized(i.Locale, lt, progress)) continue; - ////calculate hash - //List allStrings = new List(); - //foreach (var entry in lt.LT) - //{ - // if(entry.Key=="Global.Label.UseInventory.Description") continue; - // if(entry.Key=="Locale.Label.LocaleFile") continue; - // if(entry.Key=="UnitNameDisplayFormats.Label.ModelSerial") continue; - // if(entry.Key=="UnitNameDisplayFormats.Label.SerialModel") continue; - // if(entry.Key=="UnitNameDisplayFormats.Label.SerialModelVendor") continue; - // if(entry.Key=="UnitNameDisplayFormats.Label.VendorModelSerial") continue; - // if (entry.Key == "O.PartBin") continue; - - // allStrings.Add(entry.Value); - //} - //int CurrentLocaleHash = util.GetOrderIndependentHashCode(allStrings); - //allStrings.Clear(); - //if (StockLocaleHashes.Contains(CurrentLocaleHash)) continue; - //progress.Append("Locale " + i.Locale + " is customized [signature: "+CurrentLocaleHash.ToString()+"]; exporting"); + //collection to hold items sent to server List exportItems = new List(); @@ -3172,17 +3132,12 @@ namespace AyaNova.PlugIn.V8 break; } - //MAKE A DUPLICATE - //name like this: "My custom (Espanol)" etc one for each target stock language - + //MAKE A DUPLICATE var exportName = GetUniqueName(i.Locale + " (" + RavenLocaleName + ")"); progress.SubOp(""); - progress.Op("Exporting " + i.Locale + " to " + exportName); - - // var t = new util.NameIdItem { Name = exportName, Id = x }; + progress.Op("Exporting " + i.Locale + " to " + exportName); a = await util.PostAsync("translation/duplicate/" + x.ToString()); var targetTranslationId = util.IdFromResponse(a); - // var ctoken = util.CTokenFromResponse(a); //now set the name dynamic dTransName = new JObject(); @@ -3192,7 +3147,6 @@ namespace AyaNova.PlugIn.V8 dTransName.stock = false; dTransName.cjkIndex = a.ObjectResponse["data"]["cjkIndex"]; var vtemp = await util.PutAsync("translation", dTransName.ToString()); - // vtemp["data"]["concurrency"] var ctoken = util.CTokenFromResponse(vtemp); // "id": 5, //"concurrency": 92149, @@ -3222,8 +3176,7 @@ namespace AyaNova.PlugIn.V8 if (!DuplicateAvoidanceList.Contains(v8key)) { DuplicateAvoidanceList.Add(v8key); } else continue; - //System.Diagnostics.Debug.WriteLine("v7key:" + v7item.Key + " -> v8key: " + v8key); - + TranslationItem v8TransItem = trans.FirstOrDefault(m => m.Key == v8key); if (v8TransItem == null) @@ -3406,10 +3359,8 @@ namespace AyaNova.PlugIn.V8 //RateRate* s = s.Replace("RateRate", "Rate"); - - if (s.StartsWith("WorkorderStatus.Label.")) - s = s.Replace("WorkorderStatus.Label.", ""); - + s = s.Replace("WorkOrderStatusCompletedStatus", "CompletedStatus"); + s = s.Replace("WorkOrderStatusName", "StatusName"); //FUTURE // s = s.Replace("WASXXX", "NOWXXXX");