This commit is contained in:
@@ -139,6 +139,7 @@ namespace AyaNova.PlugIn.V8
|
||||
}
|
||||
//#endif
|
||||
|
||||
|
||||
Auth d = new Auth();
|
||||
var res = d.ShowDialog(); ;
|
||||
if (res == DialogResult.Cancel)
|
||||
@@ -1826,10 +1827,27 @@ namespace AyaNova.PlugIn.V8
|
||||
progress.SubOp("");
|
||||
progress.Op("Exporting " + i.Locale + " to " + exportName);
|
||||
|
||||
var t = new util.NameIdItem { Name = exportName, Id = x };
|
||||
a = await util.PostAsync("translation/duplicate", JObject.FromObject(t).ToString());
|
||||
// var t = new util.NameIdItem { Name = exportName, Id = x };
|
||||
a = await util.PostAsync("translation/duplicate/"+ x.ToString());
|
||||
var targetTranslationId = util.IdFromResponse(a);
|
||||
var ctoken = util.CTokenFromResponse(a);
|
||||
// var ctoken = util.CTokenFromResponse(a);
|
||||
|
||||
//now set the name
|
||||
dynamic dTransName = new JObject();
|
||||
dTransName.id=a.ObjectResponse["data"]["id"];
|
||||
dTransName.concurrency = a.ObjectResponse["data"]["concurrency"];
|
||||
dTransName.name=exportName;
|
||||
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,
|
||||
//"name": "en-1",
|
||||
//"stock": false,
|
||||
//"cjkIndex": false,
|
||||
|
||||
//add to maps so can set user to it on export
|
||||
//going to default to the English based one because
|
||||
//that's the majority of the users
|
||||
@@ -1865,7 +1883,7 @@ namespace AyaNova.PlugIn.V8
|
||||
exportItems.Add(new UpdateTranslationItem
|
||||
{
|
||||
Id = v8TransItem.Id,
|
||||
ConcurrencyToken = v8TransItem.ConcurrencyToken,
|
||||
Concurrency = v8TransItem.Concurrency,
|
||||
NewText = v7item.Value
|
||||
});
|
||||
}
|
||||
@@ -1891,7 +1909,7 @@ namespace AyaNova.PlugIn.V8
|
||||
public class TranslationItem
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public uint ConcurrencyToken { get; set; }
|
||||
public uint Concurrency { get; set; }
|
||||
public string Key { get; set; }
|
||||
public string Display { get; set; }
|
||||
public long TranslationId { get; set; }
|
||||
@@ -1900,7 +1918,7 @@ namespace AyaNova.PlugIn.V8
|
||||
public class UpdateTranslationItem
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public uint ConcurrencyToken { get; set; }
|
||||
public uint Concurrency { get; set; }
|
||||
public string NewText { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
public static uint CTokenFromResponse(ApiResponse a)
|
||||
{
|
||||
return a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
return a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user