Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to have localization follow browser language
5 replies. Latest Post by salonVB on September 14, 2009.
(0)
Matt Brooks
Member
4 points
6 Posts
07-10-2008 6:44 PM |
I am developing a Silverlight 2 application.
I have been able to embed multiple string resources into my .xap file. I have found how I can select which language to display by adding:
<param name="culture" value="de" /><param name="uiculture" value="de" />
To my <object> section in html.
What I would like to do is have the culture and uiculture follow the language(s) configured in my browser (auto detect).
Does anyone know how I can do that with javascript? Or straight html?
Thanks for the help,
Matt
slyi
Participant
818 points
251 Posts
07-11-2008 4:07 AM |
Please see http://silverlight.net/forums/p/14007/50506.aspx#50506
<param name="culture" value="auto" /><param name="uiculture" value="auto" />
07-11-2008 11:12 AM |
I am using Silverlight 2 Beta 2.
This does not work for me. I am using Firefox and set one and only one language, de. My app still showed en-US as my culture and UICulture.
Any other ideas?
Thanks,
07-12-2008 2:38 PM |
That is strange i just tried it now as well and it doesnt seem to work either, maybe a bug in beta 2. It was meant to be working in beta2.
As a workaround you could add it dynamiclly on the server side eg:
<%
<
07-13-2008 10:01 AM |
Actually it is working eg: http://cid-2b248d261d0e0035.skydrive.live.com/self.aspx/Public/culture-equals-auto.zip
But it is not based on user accept language host header list, from you user browser language, as this is not available on the client side, only server side. What is available on the client side is OS language which you change in control panel. http://www.microsoft.com/library/media/1033/windowsxp/images/using/setup/winxp/regional-options-click-ok.jpg
Please note the server side method is much more targeted, and i recommend this more than the client side polling.
salonVB
09-14-2009 1:29 AM |
Thanks to all for their quick and kind response, the problem is solved!