This commit is contained in:
2020-04-30 20:19:43 +00:00
parent d52604982c
commit 9477070010

View File

@@ -511,24 +511,19 @@ namespace AyaNova.PlugIn.V8
foreach (var v7item in lt.LT)
{
var v8key = Translatev7TranslationKey(v7item.Key);
TranslationItem v8TransItem = null;
foreach (TranslationItem ti in trans)
{
if (ti.Key == v8key)
{
v8TransItem = ti;
break;
}
}
TranslationItem v8TransItem = trans.FirstOrDefault(m => m.Key == v8key);
if (v8TransItem == null) { throw new ArgumentOutOfRangeException("On exporting custom locale " + i.Locale + " source key " + v7item.Key + ", destination key " + v8key + " was not found."); }
v8TransItem.Display = v7item.Value;
JObject d = JObject.FromObject(v8TransItem);
progress.SubOp("Posting key: " + v7item.Key);
//update it
await util.PutAsync("Translation/UpdateTranslationItemDisplayText", d.ToString());
await util.PutAsync("Translation/UpdateTranslationItemDisplayText",
JObject.FromObject(new UpdateTranslationItem
{
Id = v8TransItem.Id,
ConcurrencyToken = v8TransItem.ConcurrencyToken,
NewText = v7item.Value
}
).ToString());
}
}
@@ -549,6 +544,12 @@ namespace AyaNova.PlugIn.V8
public long TranslationId { get; set; }
}
public class UpdateTranslationItem
{
public long Id { get; set; }
public uint ConcurrencyToken { get; set; }
public string NewText { get; set; }
}
/// <summary>
/// Used by import, translate the old v7 translation key name into the new shorter version