[Globalization Plugin] Globalization Plugin - Locale not returned on Android

[Globalization Plugin] Globalization Plugin - Locale not returned on Android

  
Forge Component
(3)
Published on 4 Sep by André Vieira
3 votes
Published on 4 Sep by André Vieira

The Globalization Plugin does not read the preferred language correctly on Android devices if the format does not contain a comma, as listed on the Cordova documentation page for the plugin.


Returns the ISO 639-1 two-letter language code, upper case ISO 3166-1 country code and variant separated by hyphens. Examples: "en", "en-US", "US"

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-globalization/#android-quirks

Hi Gonçalo,

IT seems to be related with a small bub in the JS node of the GetPreferredLanguage action.


Just open it and change the index of the array from 1 to 0. 


It worked for me.


Best regards,

Tiago.


Solution

Hi Gonçalo,

Thanks for the feedback. I've uploaded a new version with a fix for that bug and an update to the plugin version.

Solution

Thank you both for your help, sorry for the late reply.

The new version is working as expected, take my 5 stars :)