Click here to Skip to main content
13,256,304 members (49,380 online)
Click here to Skip to main content
Add your own
alternative version


9 bookmarked
Posted 23 Sep 2008

Validate strings in Resx files for all languages

, 23 Sep 2008
Rate this:
Please Sign up or sign in to vote.
A tool to validate localization strings in Resx files supporting multiple languages.


The .NET framework provides support for language localization using resx files. This tool helps to cross check the resx files for various languages, in a GridView. The code is based on .NET 3.5.


For localization using satellite assemblies, please refer to: .NET - Localization using Resource file.

Using the code

With this utility, the user can select multiple resx files and validate if keys exist in all languages. It highlights the errors visibly in red so that a developer can quickly fix the resx files. The utility itself is a couple of lines of code.. thanks to LINQ and .NET 3.5.

void ParseFiles(string[] fileNames)
    int marker = 1;
    foreach (string file in fileNames)

        XElement xElement = XElement.Load(file);

        IEnumerable<XElement> data = 
            from text in xElement.Elements("data")
            select text;

        foreach (XElement node in data)
            string key = node.FirstAttribute.Value;

            int value = dictionary.ContainsKey(key)? dictionary[key]:0;

            dictionary[key] = value | marker;

        marker = marker << 1;

Points of interest

The code uses LINQ, and really looks neat and clean for the purpose.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralBest Localization Plug-in for Visual Studio. Pin
Alexander Nesterenko17-Dec-08 22:45
memberAlexander Nesterenko17-Dec-08 22:45 
GeneralZeta Resource Editor ;-) Pin
Uwe Keim23-Sep-08 21:54
sitebuilderUwe Keim23-Sep-08 21:54 
GeneralRe: Zeta Resource Editor ;-) Pin
nkrscorpio24-Sep-08 8:16
membernkrscorpio24-Sep-08 8:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 23 Sep 2008
Article Copyright 2008 by nkrscorpio
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid