views:

367

answers:

2

I am trying to localize an application, but I have a couple restrictions. I must use Resx-based localization (I cannot use LocBaml). Also, all resources, including the fallback resource (en-US), must be stored in a satellite assembly. No resources can be embedded with the application.

Here's my problem. Every time I add a string, I must add it to Resources.resx and then add the same string to the fallback resource, Resources.en-US.resx. If I understand it correctly, the Resources.resx file is used at compile/design time, while the Resources.en-US.resx files ends up being the one used at runtime. Is there any way around this? Can I somehow link the two so that only one file will need to be changed?

A: 

Why do you have to have an identical fallback resource? When you are done with the primary one (for the default language), just copy the resx-file to a new file.

Cecil Has a Name
Everything compiles great when putting all my strings in the default Resources.resx file. But, exceptions are thrown at runtime because it is looking for the satellite resource (Resource.en-US.resx). Most people would embed the default/fallback resource into the main assembly and this problem wouldn't occur. Unfortunately, I have been told not to so that the resources can be updated later without having to recompile the entire app. I could do the whole design now and copy later. But, this would still cause headaches for other developers when editing the form.
bsh152s
+1  A: 

How about a simple pre-Build action that copies your default .resx file(s) to the en-US version? I seem to remember that the culture-codes are not recorded inside, so a simple Copy File would do.

Henk Holterman
Good idea. I will do that.
bsh152s