C# – Resource files and satellite assemblies

cresourcessatellite-assembly

I am, for lack of a better word, a newbie to Localization and resource files. I am trying to localize an application I am working on and I want to do it using resource files and satellite assemblies, but I can't figure out how to do it correctly. Here is what I have so far:

In my project directory: I created the files LanguageText.resx and LanguageText.nl.resx

In my project/bin directory: I created the folder "nl"

In my project/bin/nl directory: I used ResGen.exe to create LanguageText.nl.resources file from LanguageText.nl.resx file, then I used AL.exe to create the project.resources.dll file. That .dll file is in the bin/nl folder. It assembled ok and now I have nl/project.resources.dll in my project/bin/debug folder as well.

My problem is that I apparently do not have a neutral language file or resource embedded in my program, but I can't find any info on how to do that. The only info I can find about embedding resources in this manner is related to satellite assemblies. How do I embed the neutral language resource?

Any help or direction is appreciated.

Thanks,
Mike

Best Answer

You can do it with the help of AssemblyInfo. Go to AssemblyInfo.cs and add the attribute

[assembly: NeutralResourcesLanguageAttribute("en-US",UltimateResourceFallbackLocation.Satellite)]

Make sure to add using statement using System.Resources; at the top. The above line indicates that the neutral resource language of your assembly is 'en-US' and this is a Satellite assembly.

Related Topic