1

I am running into trouble given the following setup:

  • Operating System is Windows 7 English, Format is German (Germany), Location is Germany
  • My Application (MVC2, .NET 4) contains 2 Resource-Files, Labels.resx (containing German content) and Labels.en.resx (containing English content)
  • CurrentCulture and CurrentUICulture are set to de-DE very early (by initializing the controller)

But the framework chooses to take the Labels.en.resx instead of using what I am expecting, the default one. So why does the fallback mechanism not work here? Any ideas?

2 Answers 2

1

Seems to be a bug related to ASP.NET 4.0. When compiling the project against 3.5 all works as expected.

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

Comments

0

It looks like the fallback works a bit differently.

If you have your browser languages set to eg.

Polish (pl), English GB (en-GB), English (en)

and you have corresponding resource files + a default resource file (e.g Literals.pl.resx, Literals.en-GB.resx, Literals.en.resx, Literals.resx) the the fallback mechanism will go:

  • Literals.pl.resx -> Literals.resx (if you have Polish first in your browser)
  • Literals.en-GB.resx -> Literals.en.resx -> Literals.resx (if you have English GB first in your browser)

The fallback works for locale, not language.

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.