3
votes

I have a problem with resx based localization.

It's an ASP.NET MVC3 project. I have two assemblies: Web and Resource. Web contains all MVC related stuff, and Resource contains resx files for localization(I am building site with 3 different languages available like file.resx, file.en-AU.resx, file.en-US.resx).

Now the weird thing is that this is all working really nicely on my local machine using VS2010 and IIS when I add the Resource project reference as a Project, but when I add the reference to the Resource.dll in my bin - it doesn't work.

I tried to output Thread.CurrentThread.CurrentUICulture in my views, just before outputting localized strings. It gives me selected culture, which is right, but nevertheless strings are rendered as a fallback value, not localized one.

Could anyone tell me why it wouldn't work if I add the reference as a dll file in my bin?

1
I noticed that I have a resource dll corresponding to each culture in their respective folders(en-US, en-UK etc). I was only adding the dll for the fallback. I am not sure how to add all the dll's instead of adding the project as a reference. - Chi

1 Answers

0
votes

If I am not wrong you should also add to your bin the generated bin, en-au and en-us folders that you should find in the bin of resource project

another option ensure you have the resource file with public accessor