This commit is contained in:
2020-04-30 18:24:09 +00:00
parent 1493e0bbfd
commit d35653a851

View File

@@ -491,17 +491,44 @@ namespace AyaNova.PlugIn.V8
int nGermanSimilar = 0; int nGermanSimilar = 0;
LocalizedTextTable ltTemp = LocalizedTextTable.Load("English"); LocalizedTextTable ltTemp = LocalizedTextTable.Load("English");
var diff = lt.LT.Where(entry => ltTemp.LT[entry.Key] != entry.Value) nEnglishSimilar = lt.LT.Where(entry => ltTemp.LT[entry.Key] != entry.Value)
.ToDictionary(entry => entry.Key, entry => entry.Value); .ToDictionary(entry => entry.Key, entry => entry.Value).Count;
ltTemp = LocalizedTextTable.Load("Français");
nFrenchSimilar = lt.LT.Where(entry => ltTemp.LT[entry.Key] != entry.Value)
.ToDictionary(entry => entry.Key, entry => entry.Value).Count;
ltTemp = LocalizedTextTable.Load("Español");
nSpanishSimilar = lt.LT.Where(entry => ltTemp.LT[entry.Key] != entry.Value)
.ToDictionary(entry => entry.Key, entry => entry.Value).Count;
ltTemp = LocalizedTextTable.Load("Deutsch");
nGermanSimilar = lt.LT.Where(entry => ltTemp.LT[entry.Key] != entry.Value)
.ToDictionary(entry => entry.Key, entry => entry.Value).Count;
string closestSource = "English";
int closestCount = nEnglishSimilar;
if (nFrenchSimilar > closestCount)
{
closestSource = "Français";
closestCount = nFrenchSimilar;
}
if (nSpanishSimilar > closestCount)
{
closestSource = "Español";
closestCount = nSpanishSimilar;
}
if (nGermanSimilar > closestCount)
{
closestSource = "Deutsch";
closestCount = nGermanSimilar;
}
progress.SubOp("Closest match to base export is " + closestSource);
//Duplicate closest match RAVEN translation, then update each value that differs from stock
//todo: somehow identify where a custom list not of our own comes from originally so can start with that list
//i.e. someone may have started with spanish then customized some of it so we need to also start with spanish and customize
//likely if can matchup some parts of it then we would know or at least guess.
//Not sure what but maybe something they can't modify, like an internal error or something?
//need a key translator so can give old and get new then just update it's value //need a key translator so can give old and get new then just update it's value
//dynamic d = new JObject(); //dynamic d = new JObject();