globalization Cordova Plug-in

This forum contains topics that were moved from Get Satisfaction
Ole Henrik Oftedal
Posts: 0
Joined: Thu Apr 19, 2012 4:52 pm

globalization Cordova Plug-in

Post by Ole Henrik Oftedal »

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