1

I think I get it, but a couple of aspects are confusing me. Say I want strings localized for MyApp in Germany, Spain and the USA.

MyApp.resx
MyApp.de-DE.resx
MyApp.es-ES.resx
MyApp.en-US.resx // this *feels* redundant

The last rex file ("en") will have the same keys and values as the "neutral" one since I am an American developer, but ... do I need both?

I can guess at the answers but it seems confusing despite, or maybe because of, all the msdn docs explaining the ultimatefallback, satellites, and neutral language.

Can someone experienced with international development explain why or why not in a (really) simple manner? And would it matter if I were doing WPF, Silverlight, ASP or some other .Net variation?

Cheers,
Berryl

3
  • Pretty hard to guess how you got them, localization is normally done with a GUI component. You'd use MyApp.en-GB.resx so you don't speak off colour to the queen. Ask the guy that wrote it. Commented Feb 5, 2012 at 23:00
  • @Hans Passant. My files are generated via Visual Studio. Not at all sure I get your point, other than American English being different than British. Please clarify. Commented Feb 5, 2012 at 23:07
  • @HansPassant. I am taking it on faith that anyone who can answer this KNOWS that I omitted en.Us as the specific culture aspects are NOT the focus of the question! Commented Feb 5, 2012 at 23:09

2 Answers 2

5

If the resources in the main assembly (MyApp.resx) are in the en-US culture, you don't need to create a MyApp.en-US.resx file. If no satellite assembly is found for this culture, the resource manager will fall back to the resources in the main assembly.

Sign up to request clarification or add additional context in comments.

Comments

0

Agreed with Thomas. If main language for your application is en-us than you just place all your strings in main resources and all translations of this strings(such as German, French etc) at corresponding satellite resource files.

For example - main language is En-Us, but u also want to support british, german, spanish. So you place all original strings in default resource file, say Resources.resx. Then you create Resources.en-GB.resx, Resources.de-De.resx, Resources.es-ES.resx and place there translations of original strings.

If some of the strings are equal for american and british versions, you just delete this strings from Resources.en-GB.resx file. Because first satellite assembly will be examined for resource, and if resource string hasn't been found - main assembly version of this string will be used.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.