Monday, May 20, 2024
164
rated 0 times [  166] [ 2]  / answers: 1 / hits: 33557  / 14 Years ago, fri, october 8, 2010, 12:00:00

I need to detect OS language using javascript so I can view my page depending on the language.



I know that we can detect the browser language but that is not enough for me.



I need Operation System language



Thanks in advance


More From » javascript-framework

 Answers
16

There is no cross-browser way to do this. Internet Explorer supports the following:




  • navigator.browserLanguage: browser language

  • navigator.systemLanguage: Windows system language

  • navigator.userLanguage: Windows user-specific language



But there is no way to access these settings from any other browsers (that I can tell) so don't use them: stick to the standard navigator.language (corresponding to the browser language) if you want to maintain cross-browser functionality. If you do use them you will tie your web site to a specific family of operating systems (i.e. Windows) and a specific browser (i.e. Internet Explorer). Do you really want to do this?



Why is the browser language insufficient for your application?


[#95375] Wednesday, October 6, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryanulyssesb

Total Points: 91
Total Questions: 105
Total Answers: 102

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
ryanulyssesb questions
Sat, Mar 20, 21, 00:00, 3 Years ago
Mon, Sep 14, 20, 00:00, 4 Years ago
Mon, Mar 9, 20, 00:00, 4 Years ago
Sun, Jul 7, 19, 00:00, 5 Years ago
;