navigator.language(s) + browser differences


I used OSX High Sierra for the following tests.

① Chrome + Firefox

navigator.languages returns Accept-Language array
navigator.language returns Accept-Language[0]

navigator.language does not return any information that I could not get from navigator.languages. These browsers operate independent of the OSX preferred language

② Opera

navigator.languages returns Accept-Language array
navigator.language returns browser UI language

Opera picks up the OSX preferred language. After changing the OSX preferred language, Opera needs to be restarted for the language change to take effect.

③ Safari

navigator.languages and navigator.language returns the single OSX preferred language.

The change of OSX preferred language is immediate. No need to restart Safari unless one wants the browser UI language to be same as OSX preferred language.

So, we have differences in browser behaviour. Is there an existing standard or a standard being developed?

My preference would be for the information returned by Opera and being independent of the OSX preferred language like Chrome and Firefox.

André Schappo

Received on Wednesday, 7 March 2018 14:25:12 UTC