Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Save way to detect Browser Language (http://www.velocityreviews.com/forums/t99655-save-way-to-detect-browser-language.html)

Matthias S. 03-30-2005 10:39 PM

Save way to detect Browser Language
 
Hi all!

What is the best way to detect the Browsers preferred language
(HTTP_ACCEPT_LANGUAGE)? Having Trace enabled I used a couple of
different Browser and figured, that they all send a different format for
this information. Is there a sort-of failsafe approach to it?

Thanks in advance!

--
/Matthias

Brock Allen 03-30-2005 10:43 PM

Re: Save way to detect Browser Language
 
Check the Request.UserLanguages collection.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi all!
>
> What is the best way to detect the Browsers preferred language
> (HTTP_ACCEPT_LANGUAGE)? Having Trace enabled I used a couple of
> different Browser and figured, that they all send a different format
> for this information. Is there a sort-of failsafe approach to it?
>
> Thanks in advance!
>





cauzon 12-28-2007 05:31 AM

navigator.browserLanguage
 
Hi Everyone,

I'm dharyl from Philippines, I had a problem in knowing the user's browser Language. I was asked to have an alert pop up when the user of the site is using other language than "en-us".
I had this code below just to test what language setting should the page read from the user.

Code: ( javascript )
<script language="JavaScript">
var a = navigator.browserLanguage;
var b = navigator.userLanguage;
var c = navigator.systemLanguage;
alert("browser language");
alert(a);
alert("user language");
alert(b);
alert("system language");
alert(c);
</script>


Code: ( text )
navigator.browserLanguage --> en-us
navigator.systemLanguage --> en-us
navigator.userLanguage --> en-us


when I change my browser language from Tools>InternetOptions>General>Languages
results are the same:

Code: ( text )
navigator.browserLanguage --> en-us
navigator.systemLanguage --> en-us
navigator.userLanguage --> en-us


when I change my browser language from
Start>ControlPanel>RegionalandLanguageOptions>Regi onal Options tab
the value of userLanguage changes just as what I set:

Code: ( text )
navigator.browserLanguage --> en-us
navigator.systemLanguage --> en-us
navigator.userLanguage --> Ja


That means navigator.userLanguage is for this one
Start>ControlPanel>RegionalandLanguageOptions>Regi onal Options tab

Now my point is how would I get the value of language setting from this one?
Tools>InternetOptions>General>Languages

Because I guess that's what I need for my task to be done.
Hope you guys can help me on this.


Thanks in advance,
dha


All times are GMT. The time now is 04:49 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.