Setting Hostnames in Umbraco Without Setting Language
I using umbraco to create a multi territory website so I have nod开发者_如何转开发es set up for each territory (not language) something like
England -- mysite.co.uk
- Content
Germany -- mysite.de
- Content
etc.
Language is then selected by user preferrence/browser (so for example even on the german site you may want to see articles in english albeit the articles on the germany version of the site).
I'm setting the Thread.Current.CurrentCulture and CurrentUICulture in the global.asax but it seems that umbraco is overriding this in the pages oninit using the language set on the hostname management screen. Unfortunately Umbraco seems to assume that hostnames are used to drive out language choices and so language is a required field on the hostname management screen. Is there any way to stop umbraco taking the language from the hostname section?
No, there is no way to stop Umbraco from setting the language based on your hostname. However, you could set it yourself in the PreLoad event.
As you noticed, Umbraco is setting the language OnInit, so you need to set the language yourself, but do it after Umbraco sets it.
精彩评论