Last post Mar 04, 2008 10:58 AM by lallouna85
Jul 14, 2006 04:26 AM|trugge|LINK
I am in the midst of localising a number of content pages and Visual Studio is a great help in autogenerating local resource pages.
However, I can't set UICulture=auto in my master pages, which means that I can't make them switch between local resoure pages depending on the language setting in the browser.
How is this problem solved, please?
Jul 16, 2006 06:14 AM|EngMotagaly|LINK
Jul 17, 2006 03:16 AM|trugge|LINK
I already set this paramater in web.config, but it doesn't solve the problem with master pages. Thanks for your ref. to vertigosoftware. However this didn't make me any the wiser re. my immediate problem
Jul 17, 2006 09:40 PM|Gordon-Freeman|LINK
Notice the MasterPage is derived form UserControl but not Page class, so actually there is no UICulture and Culture property or InitializeCulture() fot it!
One solution is as blows:
Set a default culture in web.config (English for example), then let the user choose preferred language. Once he chose one, store the value in Cookie or Profile, or any where you want.
Create a Global.asax, in Application_BeginRequest(), read culture setting from where you stored it, then set Thread.CurrentThread.CurrentUICulture and Thread.CurrentThread.CurrentCulture. This is because BeginRequest is touched off before the MasterPage's
Additional, the first time the user selected his culture, you should refresh that page to make it work. xD
Jul 17, 2006 09:45 PM|Gordon-Freeman|LINK
Mar 04, 2008 10:58 AM|lallouna85|LINK
hi is there a way that I can from the master page to change UICulture to all content page if they contains local ressources in different locations.???