Reputation: 89
I have to build a localized application in JavaScript (jQuery Mobile, phonegap). Each time I ask the language(navigator.language) it returns me "en" even when I set the phone language on French or Spanish.
How can I detect the phone language instead of the navigator language which don't seem to change accordingly to phones?
Upvotes: 2
Views: 2616
Reputation: 12249
It is not possible to detect the phone's language as far as I know. Using the user-agent or navigator.language are the only automated ways.
However, it is probably safest to just ask the user what language they speak.
Upvotes: 1