Created
July 9, 2010 17:39
-
-
Save j4johnfox/469757 to your computer and use it in GitHub Desktop.
This file contains 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
- (CPString)browserLanguage | |
{ | |
// IE uses userLanguage to return the code. For now, we'll just deal with | |
// the "base" language (e.g. "en" vs. "en-GB" | |
var userLang = (navigator.language) ? navigator.language : navigator.userLanguage; | |
return userLang.substring(0,2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment