Tuesday, September 4, 2012

How to detect browsers language preference?

By Javascript:
var language = window.navigator.userLanguage || window.navigator.language;

By check request header on server side:
Request.Headers["Accept-Language"]
Accept-Language:en-US;q=0.8,en;q=0.6

No comments:

Post a Comment