E
E
Evgeny572019-08-23 13:34:02
JavaScript
Evgeny57, 2019-08-23 13:34:02

How to get android system language in js?

I made an application from the site, how to get the language of the android system using js, to change the language of the site?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny57, 2019-08-23
@Evgeny57

var userLang = navigator.language || navigator.userLanguage;

S
sim3x, 2019-08-23
@sim3x

The browser does not provide access to the system Browser has an
Accept-Language header on the back
https://www.w3.org/International/questions/qa-lang...
There is an experimental api
https://developer.mozilla.org/en-US /docs/Web/API/N...
In any case - nothing can be forced to change
You can suggest changing the language to "more suitable"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question