Been searching for this for a while and can’t see a clear answer.
–> Is there a way to detect the handset language for iphone/ android handsets from within mobile web.
We want to try and improve the way we serve our pages for languages other than english.
In JavaScript
window.navigator.languageusually works except for earlier versions of Android which have it hardcoded toen.For older Androids I suggest pulling the language parameter out of the UserAgent string (yes sniffing!), e.g.
Here, lang might also contain the country code (e.g. ‘en-IE’) so you might have to remove that also:
This is what I’ve used in a recent app and it works fine.