Detecting the browser language is a good way to implement multi-lingual websites. Usually users choose their language through some "dropdown" (or country flags). But it would be best, if your application automatically detects the browser language, and renders content based on that.
Use navigator.language to Detect Browser Language
// Current browser language var language = window.navigator.language
The language returned by navigator.language is a string as defined in RFC BCP-47.
In case you want to use Google Translate API, you can easily convert this to a ISO-639 string (Google Translate API supports languages conforming to ISO-639).
navigator.language will work good in all modern browsers including IE11+.