cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@chromium.org>
Subject Re: Globalization broken in Cordova 3.3, iOS
Date Wed, 22 Jan 2014 01:54:55 GMT
There's a bug right now where you need to run "cordova prepare" after
installing a new plugin. Maybe you're hitting that?


On Tue, Jan 21, 2014 at 4:38 PM, Jamie Perkins <jamie.perkins@gmail.com>wrote:

> Hmm, nope. I definitely wait for the 'deviceready' event.
>
> I even tested it directly in the "Hello Cordova" project by adding it
> right into here:
>
> var app = {
>     initialize: function() {
>         this.bindEvents();
>     },
>     bindEvents: function() {
>         document.addEventListener('deviceready', this.onDeviceReady,
> false);
>     },
>     onDeviceReady: function() {
>         app.receivedEvent('deviceready');
>     },
>     receivedEvent: function(id) {
>         var parentElement = document.getElementById(id);
>         var listeningElement = parentElement.querySelector('.listening');
>         var receivedElement = parentElement.querySelector('.received');
>
>         listeningElement.setAttribute('style', 'display:none;');
>         receivedElement.setAttribute('style', 'display:block;');
>         var lang = '';
>         navigator.globalization.getPreferredLanguage(function (language) {
>             console.log('automatically detected language:
> '+language.value);
>             lang = language.value.substr(0,2);
>         }, function() {
>             console.log('error retrieving language')
>         });
>
>         console.log('Received Event: ' + id);
>     }
> };
>
>
> - get nothing. Also - console isn't logging either. Had to rerun
> 'app.initialize()' in safari web inspector. Am I going crazy here?
>
>
> On Tue, Jan 21, 2014 at 2:05 PM, Andrew Grieve <agrieve@chromium.org>wrote:
>
>> You can create issues here: https://issues.apache.org/jira/browse/CB/
>>
>> Sounds like you have forgotten to wait for the "deviceready" event before
>> calling the API.
>>
>>
>> On Tue, Jan 21, 2014 at 1:19 PM, Jamie Perkins <
>> jamie@inorganikproduce.com> wrote:
>>
>>> Hi Adam,
>>>
>>> I wasn't sure how to create an issue at git-wip-us.apache.org, so sorry
>>> for the email.
>>>
>>> It appears globalization doesn't work for Cordova 3.3, at least for iOS.
>>> Please see a complete summary here:
>>> http://stackoverflow.com/questions/21249086/globalization-broken-in-cordova-3-x
>>>
>>> Project I created is using  v 0.2.5 (Jan 02, 2014) of your plugin, and a
>>> quick check in the console shows while it is running in the iOS simulator
>>> for 'navigator.globalization' returns 'undefined'.
>>>
>>> Thanks,
>>> Jamie
>>>
>>> *Inorganik Produce*
>>> PO Box 19263, Denver, CO 80219
>>> Office: 720-744-3333
>>> Cell: 720-635-9563
>>> jamie@inorganikproduce.com
>>> http://inorganikproduce.com
>>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message