Fred
Fred

Reputation: 636

WPF and Localization

I've a quite obvious problem. Here's the situation: - my WPF application is primarily written in German - I've to use resx-files (standard way in the company) - the fallback-language must be English. - the german resources are the base for all translations (including English)

I've tried many combinations with "[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.Satellite)]" and setting in the csproj file, but unfortunately, I couldn't find one that works fine.

Thx in advance for your help! Fred

Upvotes: 2

Views: 606

Answers (1)

Julian Dominguez
Julian Dominguez

Reputation: 2583

If the English resources will always have fallback values, I'd recommend embedding that language into the main assembly itself. This way you can use:

[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.MainAssembly)]

For this to work, remove the change you did to the csproj. Also note that the language you set must not be neutral, in spite of the attribute name (i.e. use en-US instead of en)

This way, satellite assemblies will only be generated for languages other than English.

You can read more here: http://compositeextensions.codeplex.com/Thread/View.aspx?ThreadId=52910

Upvotes: 1

Related Questions