You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Andrew Grieve <ag...@chromium.org> on 2014/01/22 02:54:55 UTC
Re: Globalization broken in Cordova 3.3, iOS
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 <ja...@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 <ag...@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
>>>
>>
>>
>
Re: Globalization broken in Cordova 3.3, iOS
Posted by Andrew Grieve <ag...@chromium.org>.
https://issues.apache.org/jira/browse/CB-5647
On Wed, Jan 22, 2014 at 11:35 AM, Jamie Perkins <ja...@gmail.com>wrote:
> Thanks. Is there a link to that bug so I can track it?
>
>
> On Tue, Jan 21, 2014 at 6:55 PM, Andrew Grieve <ag...@chromium.org>wrote:
>
>> Ah, (didn't see your last message). Yeah, you hit the "didn't run
>> prepare" bug then. We do support building from the IDE, doing so going
>> forward should work fine.
>>
>>
>> On Tue, Jan 21, 2014 at 8:54 PM, Andrew Grieve <ag...@chromium.org>wrote:
>>
>>> 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 <ja...@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 <ag...@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
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
Re: Globalization broken in Cordova 3.3, iOS
Posted by Andrew Grieve <ag...@chromium.org>.
Ah, (didn't see your last message). Yeah, you hit the "didn't run prepare"
bug then. We do support building from the IDE, doing so going forward
should work fine.
On Tue, Jan 21, 2014 at 8:54 PM, Andrew Grieve <ag...@chromium.org> wrote:
> 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 <ja...@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 <ag...@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
>>>>
>>>
>>>
>>
>