track whether the item has been translated yet

This commit is contained in:
Tim Young 2017-10-31 09:08:21 -05:00
parent 3a8adbb7e1
commit ef47d491f2

View File

@ -326,6 +326,7 @@ namespace EduNetworkBuilder
public string filename;
List<TranslationItem> Items = new List<TranslationItem>();
public string language = "";
string beginning = "translated: ";
public TranslationResxFile(string File)
{
@ -356,6 +357,12 @@ namespace EduNetworkBuilder
ResXDataNode rdn = (ResXDataNode)d.Value;
TranslationItem TI = new TranslationItem();
TI.Comment = rdn.Comment;
if (TI.Comment.StartsWith(beginning))
{
//trim off the beginning "translated" tag
TI.Comment = rdn.Comment.Substring(0, beginning.Length - 1);
TI.translated = true;
}
TI.Key = rdn.Name;
TI.Value = (string)rdn.GetValue(new System.Reflection.AssemblyName[] { currentAssembly.GetName() });
Items.Add(TI);
@ -371,7 +378,10 @@ namespace EduNetworkBuilder
foreach (TranslationItem d in Items)
{
ResXDataNode rdn = new ResXDataNode(d.Key, d.Value);
rdn.Comment = d.Comment;
if (d.translated)
rdn.Comment = beginning + d.Comment;
else
rdn.Comment = d.Comment;
WriteResx.AddResource(rdn);
//Console.WriteLine("Adding " + toWrite.Name);
}