bsh152s
bsh152s

Reputation: 3218

In C#, How can I create satellite resource that will be used at design time?

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?

Upvotes: 1

Views: 778

Answers (2)

Henk Holterman
Henk Holterman

Reputation: 273274

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.

Upvotes: 2

Cecil Has a Name
Cecil Has a Name

Reputation: 4992

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.

Upvotes: 0

Related Questions