LocUtil: fix resx file tag indenting

This commit is contained in:
Nick Vella 2019-08-05 16:36:08 +10:00
parent 154a4f1495
commit fbe23bbaa5
2 changed files with 993 additions and 488 deletions

View File

@ -304,7 +304,16 @@ namespace LocUtil
}
}
}
xmlDoc.Save(path);
// Correct the formatting as to not create needlessly large diffs
var sb = new StringBuilder();
var stringWriter = new Utf8StringWriter(sb);
xmlDoc.Save(stringWriter);
File.WriteAllText(path,
sb.ToString()
.Replace(" <comment>", " <comment>") // Fix comment tag indent
.Replace("</comment></data>", "</comment>\r\n </data>"), // Move data close following comment close onto own line
Encoding.UTF8);
}
// @RIBBON TODO: For now the union of the command in Commands.xml and Ribbon.xml will go into the CommandId enum.
@ -695,4 +704,14 @@ namespace OpenLiveWriter.Localization
}
}
}
internal sealed class Utf8StringWriter : StringWriter
{
public Utf8StringWriter(StringBuilder sb) : base(sb)
{
}
public override Encoding Encoding => Encoding.UTF8;
}
}

File diff suppressed because it is too large Load Diff