views:

156

answers:

1

Hi,

I've a portal with two different alias, one for eache language: - en.mysite.com - it.mysite.com

Now I've the issue to have English language on the first portal and Italian on the second one.

What I've done is to add the following line in the default.vb.aspx in the Page_Load:

If Request.Url.Host = "en.mysite.com" Then System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-GB") ElseIf Request.Url.Host = "it.mysite.com" Then System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("it-IT") Else System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-GB") End If

It partially works, the LOCALE variable is correctly set, but I've noticed that:

  • the combobox of the language is not set correctly
  • the html tag doesn't change, it always remains with the default language of the portal, in my case it-IT
  • the localization module doesn't run, for eg using Locopon to change the TabName for each language doesn't work.

I think the the previous issues are related to the same thing, but I don't know how to solve it

thanks

A: 

You have to set it much earlier than Page_Load by overriding InitializeCulture(). This makes it a bit tricky when interacting with other things (e.g. if you want to set it from a form control you need to directly access the request). Here's the basics:

http://msdn.microsoft.com/en-us/library/bz9tc508.aspx

FinnNk