开发者

How does ASP.Net detect the Culture

开发者 https://www.devze.com 2023-03-16 21:46 出处:网络
I have an ASP.Net site where I have a default.aspx.resx and a default.aspx.no.resx. I have configured my browser (Chrome) with \"Norwegian Bokmål (nb)\", \"Norwegian (no)\" and \"English (en)\".

I have an ASP.Net site where I have a default.aspx.resx and a default.aspx.no.resx. I have configured my browser (Chrome) with "Norwegian Bokmål (nb)", "Norwegian (no)" and "English (en)".

With Culture and UICulture set to auto in Web.config, I would assume that the no.resx file would be chosen, as that entry is before the english entry. However, 开发者_如何学Pythonunless no is the first option, the default is always chosen. Also, for "Norwegian Bokmål (nb)" the fallback should be "Norwegian (no)".

Am I missing some settings, or is ASP net not fully functional in this aspect, and I need to implement my own culture detection algorithm?


Using resources for localization with ASP.NET


To me, ASP.Net seems buggy when detecting language. My solution was to implement my own culture resolution, that looks at all UserLanguages in order.

0

精彩评论

暂无评论...
验证码 换一张
取 消