There is a task: to first enter the mobile application, you need to determine the language of the Android / IOS device from which it is running. The application itself is written using the Apache Cordova platform, using standard web technologies Js, HTML, CSS. Guys, can anyone come across such a problem? Language definition by geolocation does not roll = (
- onestackoverflow.com/questions/13864359/… try or stackoverflow.com/questions/673905/… . - pavel
- onecordova.apache.org/docs/en/latest/reference/… here's the plug - in for you - Max Mikheyenko
- Guys, thanks, but as far as I understand window.navigator renders the language of the user interface of the browser, the language of the device may differ. - Konstantin Andryushkov
- one@ KonstantinAndryushkov, can not. (For Android) - Vladyslav Matviienko
- All the same, the navigator works as it should, just some locales of the device in the application have been reassigned to another language. Thank you) - Konstantin Andryushkov
|
1 answer
For iOS, you can take this plugin (or any other for working with NSUserDefaults) and get an array of strings using the "AppleLanguages" key. The first element is the current language + locale.
https://github.com/protonet/cordova-plugin-nsuserdefaults-for-app-groups
|