track whether the item has been translated yet
This commit is contained in:
parent
3a8adbb7e1
commit
ef47d491f2
@ -326,6 +326,7 @@ namespace EduNetworkBuilder
|
|||||||
public string filename;
|
public string filename;
|
||||||
List<TranslationItem> Items = new List<TranslationItem>();
|
List<TranslationItem> Items = new List<TranslationItem>();
|
||||||
public string language = "";
|
public string language = "";
|
||||||
|
string beginning = "translated: ";
|
||||||
|
|
||||||
public TranslationResxFile(string File)
|
public TranslationResxFile(string File)
|
||||||
{
|
{
|
||||||
@ -356,6 +357,12 @@ namespace EduNetworkBuilder
|
|||||||
ResXDataNode rdn = (ResXDataNode)d.Value;
|
ResXDataNode rdn = (ResXDataNode)d.Value;
|
||||||
TranslationItem TI = new TranslationItem();
|
TranslationItem TI = new TranslationItem();
|
||||||
TI.Comment = rdn.Comment;
|
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.Key = rdn.Name;
|
||||||
TI.Value = (string)rdn.GetValue(new System.Reflection.AssemblyName[] { currentAssembly.GetName() });
|
TI.Value = (string)rdn.GetValue(new System.Reflection.AssemblyName[] { currentAssembly.GetName() });
|
||||||
Items.Add(TI);
|
Items.Add(TI);
|
||||||
@ -371,7 +378,10 @@ namespace EduNetworkBuilder
|
|||||||
foreach (TranslationItem d in Items)
|
foreach (TranslationItem d in Items)
|
||||||
{
|
{
|
||||||
ResXDataNode rdn = new ResXDataNode(d.Key, d.Value);
|
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);
|
WriteResx.AddResource(rdn);
|
||||||
//Console.WriteLine("Adding " + toWrite.Name);
|
//Console.WriteLine("Adding " + toWrite.Name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user