Multi-lingual support?

Hi, I’m trying to develop a game with support for multiple languages on cocos2d-html5, storing my language files in different files and loading them thru a menu, I’m guessing this should work just fine if I compile the app to say Android via JSB.

But there’s one thing I don’t know: is there a way to auto-detect the users language (like you use window.navigator.language on browsers) that would be cross-platform compatible?