I'm going to detect user's keyboard language by javascript. I got a input (type of text) which should be filled with Persian characters. So, I need to alarm users change their keyboard language if their language is not Persian.
What I have found is this:
window.navigator.language;
which detects browser's language which is always En-us.
How could I solve that?
You can try like this:-
var language = window.navigator.userLanguage || window.navigator.language;
alert(language);
navigator.userLanguage works for IE
window.navigator.language works for firefox/opera/safari
Also check out this Thread
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With