Created
December 24, 2013 16:00
-
-
Save tkmru/8115085 to your computer and use it in GitHub Desktop.
How to get browser language. http://blog.masuidrive.jp/2008/09/19/how-to-detect-your-browser-language-from-javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function browserLanguage() { | |
| try { | |
| return (navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0,2) | |
| } | |
| catch(e) { | |
| return undefined; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment