How to get the browser language using JavaScript
Try this script to get your browser language
<script type="text/javascript">
var userLang = navigator.language || navigator.userLanguage;
alert ("The language is: " + userLang);
</script>
Cheers
The "JavaScript" way:
var lang = navigator.language || navigator.userLanguage; //no ?s necessary
Really you should be doing language detection on the server, but if it's absolutely necessary to know/use via JavaScript, it can be gotten.