Search code examples
c#localizationresx

How to determine the language of a RESX file


I've read something from the web, and it makes me confused.

The .resx file (comes from any applications) can be:

  1. + 'Language' + '.' + + '.resX' (ex: Word.fr-CA.resx)

  2. or just "Word.resx"

Then how can I determine the language of a resx file when I open I the program?

There is no tag or element like "xml:lang" in the resx file.

Should I use the "extension" of the file to decide its language-locale?

Thanks.


Solution

  • It is purely done by naming conventions,

    • Word.fr-CA.resx or any similar is for fr-CA (the culture).
    • Word.resx is the neutral one, which should match the culture defined in [assembly:NeutralResourcesLanguageAttribute].

    http://msdn.microsoft.com/en-us/library/hhz003sc.aspx