.netsortingresourcesresx

How to sort a . resx (resource file) in .NET


I have a problem with resource files in my project. As I created one in English, I gave it to the translation team. Somehow, they returned me resource file with values in different order, so it wasn't sorted alphabetically.

So, at first it was:

<data name="a1" xml:space="preserve">
   <value>some text2</value>
</data>
<data name="b1" xml:space="preserve">
   <value>some text3</value>
</data>
<data name="c1" xml:space="preserve">
   <value>some text1</value>
</data>

and I received:

<data name="c1" xml:space="preserve">
   <value>some text1</value>
</data>
<data name="a1" xml:space="preserve">
   <value>some text2</value>
</data>
<data name="b1" xml:space="preserve">
   <value>some text3</value>
</data>

So, is there any way to sort those elements in the .resx file by the <data name attribute?


Solution

  • SortRESX is a simple executable created by Tom Clement on CodeProject.

    It sorts *.resx file alphabetically. I described it on my blog.