I have a web forms site that needs to be localized. I mean, it is localized, I just need to set the right language according to the domain. Something like:
protected override void InitializeCulture()
{
var i = Request.Url.Host.ToLower();
var domain = i.Substring(i.Length - 2, 2);
if (domain == "se")
{
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture("sv-SE");
Thread.CurrentThread.CurrentUICulture = new
CultureInfo("sv-SE");
}
else if (domain == "dk")
{
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture("da-DK");
Thread.CurrentThread.CurrentUICulture = new
CultureInfo("da-DK");
}
}
My first question is: Do I really have to call InitializeCulture()
on every single page for the right resources the be loaded?
Second question. I also have some global resources. If yes to first question, will they be set correctly as well?
Ps. uiCulture="auto"
and enableClientBasedCulture="true"
in webconfig will not be sufficient (long story).