Last post Aug 06, 2010 11:17 PM by ketan_al
Aug 05, 2010 05:24 PM|Nullio|LINK
I have a very simple bilingual site with a link at the bottom that will allow users to switch between the two languages (english/french). the the web.config I have the following line:
<globalization culture="auto" uiCulture="auto" />
This allows for whatever the users browser culture is to be the default lanauge but I'd still like the ablility for them to click a bottom button to toggle. whats the best what to go about doing this?
Aug 05, 2010 10:27 PM|ketan_al|LINK
Please refer following
hope this helps
Aug 06, 2010 10:51 AM|ankur.nigam|LINK
To implement this functionality, you need to override InitializeCulture() method which is best place to specify culture related settings. In this method, you can check which option is selected by user and set the culture accordingly.
Here is the code that you need. In the sample code below, the page's culture is set to English-UK.
Protected Overrides Sub InitializeCulture()
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB")
System.Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-GB")
Aug 06, 2010 04:14 PM|Nullio|LINK
Isn't initializeCulture part of the Page base class? how is this done in MVC?
Aug 06, 2010 04:58 PM|ankur.nigam|LINK
I have no clue on how to implement it in MVC, I don't work on it.
Probably, you may refer some MVC forums to find its equivalent or its another better suited MVC implementation.
Aug 06, 2010 11:17 PM|ketan_al|LINK