Do NOT deprecate this plugin
navigator.language simply returns the first language set by the user in the device.
getLocaleName does much more than that. getLocaleName will return the language the OS chose after running a resolution algorithm. This includes matching declared languages by the user with supported languages within the App (it can get quite sophisticated; follow the links below).
For example:
- A user may have set this list of preferred languages: German, Spanish and English (in that order).
- A developer may develop an app in Spanish and English.
navigator.language will simply return German both in iOS and Android. I have checked that.
getLocaleName will correctly return Spanish both in iOS and Android. Also checked.
Learn more about Android language resolution here: https://developer.android.com/guide/topics/resources/multilingual-support
And about iOS resolution here: https://developer.apple.com/library/archive/qa/qa1828/_index.html
Thanks for the feedback. This plugin is now part of a more general discussion in https://github.com/apache/cordova/issues/185.
I would favor continuing to support this plugin for a while, at least. Does not seem like a super huge support burden to me.
Yes, I have been using navigator.language to get the culture, but a client complained this is not what language his OS is running (just the browser), so I now want to be able to get the actual OS and not browser language (so am about to use this)
@brodybits similar scenario for us as well we would like to get device time format that can be fetched from globalization plugin instead of Locale time format(that comes with ECMA Intl API)
We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution.