Determining the user’s language in JavaScript
When one wants to use JavaScript to add language-specific content to a page (for instance, for localization), the only cross-browser property available is navigator.language, which unfortunately represents the browser’s language, not the user’s preferred language — that browsers often make configurable.
This makes navigator.language pretty much inappropriate as a base for a solid localization effort.
While the browser sends the preferred language with each request to any server through the Accept-Language HTTP header, the client-side JavaScript engine doesn’t have access to the value of that header, and so cannot even try to parse it to determine the user’s preferred language.
