Hi!
When testing the globalization Cordova Plug-in I first include the Plug-in in my project (it was already included ).
Then I put this in the on-device ready event:
"
function getLocaleName2() {
navigator.globalization.getLocaleName(onSuccess, onError);
Code: Select all
function onSuccess(locale) {
alert('locale: ' + locale.value);
}
function onError() {
alert('Error getting locale');
}
}
alert(getLocaleName2());
"
I run start the app on my phone with Appery.io Tester
Then I get two messages (instead of one)
==========================
Alert
undefined
==========================
and then
==========================
Alert
locale: nb-NO
==========================
Why is this happening here? The first message I do not want. The second message is correct.
Do I need to initialize something or any parameters I need to set first? Or is it a bug?
Best regards
Ole Henrik Oftedal
Timeflex Systemer AS
https://www.timeflex.no
http://www.timeflex.com