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: 1171 | Points: 40

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.
In your web.config file, you need to set the following globalization tag with the values shown below:

enableClientBasedCulture="true" />

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