0
votes

I'm trying to localize my application with satellite assemblies. I tried to follow this blog: http://msdn.microsoft.com/en-us/library/21a15yht(v=vs.110).aspx

I've created two files, one file has the name "Global.resx" with an english string, and the second file has the name "Global.nl-NL.resx" with a dutch string.

After this i created a .resources file from the dutch file with resgen. With al.exe I made a .dll called LocalizationLab.resources.dll and i stored it in the folder: /bin/debug/nl-NL.

in my application i set the CurrentUICulture to nl-NL. and i call the string with Global.test. See underneath

Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
        Console.WriteLine(Global.Test);    

This returns the english string instead of the dutch one. When i debug and take a look into Global and watch the resourcesets the resourcemanager is using, I see three resourcesets: "nl", "nl-NL" and "" all three of them have english string values in them.

Can anyone tell me what i'm doing wrong?

Thanks in advance.

1

1 Answers

0
votes

I eventually found out what the problem was,

The problem was that the generated code for initializing the resourcemanager was looking like:

ResourceManager rm = new ResourceManager("LocalizationLab.Global", typeof(Global).Assembly);  

After some puzzling i found out that it should be this:

ResourceManager rm = new ResourceManager("Global", typeof(Global).Assembly); 

which worked!