This commit is contained in:
@@ -500,7 +500,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var exportName = i.Locale + " (" + RavenLanguageList.Find(m => m.Id == x).Name + ")";
|
var exportName = i.Locale + " (" + RavenLanguageList.Find(m => m.Id == x).Name + ")";
|
||||||
progress.Op("Exporting " + i.Locale + " to " + exportName);
|
progress.Op("Exporting " + i.Locale + " to " + exportName);
|
||||||
var t = new util.NameIdItem { Name = exportName, Id = x };
|
var t = new util.NameIdItem { Name = exportName, Id = x };
|
||||||
a = await util.PostAsync("Translation/Duplicate",JObject.FromObject(t).ToString());
|
a = await util.PostAsync("Translation/Duplicate", JObject.FromObject(t).ToString());
|
||||||
var targetTranslationId = util.IdFromResponse(a);
|
var targetTranslationId = util.IdFromResponse(a);
|
||||||
var ctoken = util.CTokenFromResponse(a);
|
var ctoken = util.CTokenFromResponse(a);
|
||||||
//Ok, have our target locale created, not we need to insert our custom translations one by one
|
//Ok, have our target locale created, not we need to insert our custom translations one by one
|
||||||
@@ -511,24 +511,19 @@ namespace AyaNova.PlugIn.V8
|
|||||||
foreach (var v7item in lt.LT)
|
foreach (var v7item in lt.LT)
|
||||||
{
|
{
|
||||||
var v8key = Translatev7TranslationKey(v7item.Key);
|
var v8key = Translatev7TranslationKey(v7item.Key);
|
||||||
TranslationItem v8TransItem = null;
|
TranslationItem v8TransItem = trans.FirstOrDefault(m => m.Key == v8key);
|
||||||
foreach (TranslationItem ti in trans)
|
|
||||||
{
|
|
||||||
if (ti.Key == v8key)
|
|
||||||
{
|
|
||||||
v8TransItem = ti;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (v8TransItem == null) { throw new ArgumentOutOfRangeException("On exporting custom locale " + i.Locale + " source key " + v7item.Key + ", destination key " + v8key + " was not found."); }
|
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);
|
progress.SubOp("Posting key: " + v7item.Key);
|
||||||
//update it
|
//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 long TranslationId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UpdateTranslationItem
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint ConcurrencyToken { get; set; }
|
||||||
|
public string NewText { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used by import, translate the old v7 translation key name into the new shorter version
|
/// Used by import, translate the old v7 translation key name into the new shorter version
|
||||||
|
|||||||
Reference in New Issue
Block a user