asp_net
asp_net

Reputation: 3597

ASP.NET Localization - use default resource

I am running into trouble given the following setup:

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?

Upvotes: 1

Views: 883

Answers (2)

Chris
Chris

Reputation: 12282

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.

Upvotes: 0

asp_net
asp_net

Reputation: 3597

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

Upvotes: 1

Related Questions