From b8f98f0e1b6cb821ff244a6fd10a53d2e3a241b3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 30 Apr 2020 22:54:46 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 4858e57..3066e07 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -493,6 +493,8 @@ namespace AyaNova.PlugIn.V8 if (StockLocaleHashes.Contains(CurrentLocaleHash)) continue; progress.Op("Locale " + i.Locale + " is customized"); + //collection to hold items sent to server + List exportItems = new List(); //Iterate all RAVEN languages for (int x = 1; x < 5; x++)//first four translations are the stock ones @@ -526,18 +528,21 @@ namespace AyaNova.PlugIn.V8 throw new ArgumentOutOfRangeException("On exporting custom locale " + i.Locale + " source key " + v7item.Key + ", destination key " + v8key + " was not found."); } - progress.SubOp("Posting key: " + v7item.Key); - //update it - await util.PutAsync("Translation/UpdateTranslationItemDisplayText", - JObject.FromObject(new UpdateTranslationItem + //collect + exportItems.Add(new UpdateTranslationItem { Id = v8TransItem.Id, ConcurrencyToken = v8TransItem.ConcurrencyToken, NewText = v7item.Value - } - ).ToString()); - + }); } + + + //update it + progress.SubOp("Posting translation to server "); + await util.PutAsync("Translation/UpdateTranslationItemsDisplayText", + JArray.FromObject(exportItems).ToString()); + } }