Created
December 14, 2016 05:37
-
-
Save bricelam/7b3413669c509c5a85ffa3435336cdae to your computer and use it in GitHub Desktop.
Normalize .resx files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.IO; | |
using System.Linq; | |
using System.Resources; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var reader = ResXResourceReader.FromFileContents(File.ReadAllText(args[0])); | |
var writer = new ResXResourceWriter(args[0]); | |
foreach (var entry in reader.Cast<DictionaryEntry>().OrderBy(e => e.Key)) | |
writer.AddResource((string)entry.Key, entry.Value); | |
writer.Generate(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment