132
Views
3
Comments
Solved
[Globalization Plugin] Globalization Plugin - Locale not returned on Android
Question
globalization-plugin
Mobile icon
Forge asset by Fábio Fantato

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

2020-03-05 15-52-45
André Vieira
Staff
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.

2018-07-03 08-33-54
Tiago Gafeira
Champion

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.


2020-03-05 15-52-45
André Vieira
Staff
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.

2023-02-20 18-27-41
Gonçalo Soares

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

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.