How do you detect the user's language preference on ones computer?

 Posted by Bharathi Cherukuri on 7/25/2012 | Category: ASP.NET Interview questions | Views: 2392 | Points: 40
Answer:

By using the Request object’s UserLanguages property you can return a list of the user’s language preferences. In that displayed UserLanguages, the first element of the array is the user’s current language on his/her computer.
Example:
In your web.config file, you need to set the following globalization tag with the values shown below:

<system.web>
<globalization
uiCulture="auto"
culture="auto"
enableClientBasedCulture="true" />
</system.web>


The above code is enough to have the user use his preferred language with his/her web application.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response