[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14131352#comment-14131352 ] ASF GitHub Bot commented on CB-7515: Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugin-globalization/pull/24 > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14131351#comment-14131351 ] ASF subversion and git services commented on CB-7515: - Commit aa66116f8b4e34209e47fee21adba40441cd45ca in cordova-plugin-globalization's branch refs/heads/master from [~zalun] [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-globalization.git;h=aa66116 ] Merge branch 'CB-7515_fixl10n_read_event' > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14131347#comment-14131347 ] ASF GitHub Bot commented on CB-7515: GitHub user zalun opened a pull request: https://github.com/apache/cordova-plugin-globalization/pull/24 CB-7515 Hold the information if L10n was ready before. You can merge this pull request into a Git repository by running: $ git pull https://github.com/zalun/cordova-plugin-globalization CB-7515_fixl10n_read_event Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-globalization/pull/24.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #24 commit 01bb703f45bb3bd2f2e4d268880b3c64ad68 Author: Piotr Zalewa Date: 2014-09-12T10:16:32Z Hold the information if L10n was ready before. > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129194#comment-14129194 ] ASF GitHub Bot commented on CB-7515: Github user rodms10 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-globalization/pull/22#discussion_r17391733 --- Diff: src/firefoxos/GlobalizationProxy.js --- @@ -24,12 +24,25 @@ var GlobalizationError = require('./GlobalizationError'); var l10n_loaded = new Event('l10n_loaded'); var l10n_ready = new Event('l10n_ready'); +var is_l10n_ready = false; + document.addEventListener('l10n_loaded', function() { + console.log('DEBUG: L10n loaded'); navigator.mozL10n.ready(function() { +console.log('DEBUG: L10n ready'); --- End diff -- Ah OK, I though it was left over code from when you were developing. I'm fine with keeping it. > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129183#comment-14129183 ] ASF GitHub Bot commented on CB-7515: Github user zalun commented on a diff in the pull request: https://github.com/apache/cordova-plugin-globalization/pull/22#discussion_r17391437 --- Diff: src/firefoxos/GlobalizationProxy.js --- @@ -24,12 +24,25 @@ var GlobalizationError = require('./GlobalizationError'); var l10n_loaded = new Event('l10n_loaded'); var l10n_ready = new Event('l10n_ready'); +var is_l10n_ready = false; + document.addEventListener('l10n_loaded', function() { + console.log('DEBUG: L10n loaded'); navigator.mozL10n.ready(function() { +console.log('DEBUG: L10n ready'); --- End diff -- I was thinking it might be useful for someone who is working with translations... Would help to detect race condition... > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129047#comment-14129047 ] ASF GitHub Bot commented on CB-7515: Github user rodms10 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-globalization/pull/22#discussion_r17386923 --- Diff: src/firefoxos/GlobalizationProxy.js --- @@ -24,12 +24,25 @@ var GlobalizationError = require('./GlobalizationError'); var l10n_loaded = new Event('l10n_loaded'); var l10n_ready = new Event('l10n_ready'); +var is_l10n_ready = false; + document.addEventListener('l10n_loaded', function() { + console.log('DEBUG: L10n loaded'); navigator.mozL10n.ready(function() { +console.log('DEBUG: L10n ready'); --- End diff -- Remove debug logging. > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129045#comment-14129045 ] ASF GitHub Bot commented on CB-7515: Github user rodms10 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-globalization/pull/22#discussion_r17386903 --- Diff: src/firefoxos/GlobalizationProxy.js --- @@ -24,12 +24,25 @@ var GlobalizationError = require('./GlobalizationError'); var l10n_loaded = new Event('l10n_loaded'); var l10n_ready = new Event('l10n_ready'); +var is_l10n_ready = false; + document.addEventListener('l10n_loaded', function() { + console.log('DEBUG: L10n loaded'); navigator.mozL10n.ready(function() { +console.log('DEBUG: L10n ready'); +is_l10n_ready = true; document.dispatchEvent(l10n_ready); }); }); +function callIfL10nReady(callback) { +if (is_l10n_ready) { +return callback(); +} +document.addEventListener('l10n_ready', callback); --- End diff -- Please remove the event listener to avoid memory leak. > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129046#comment-14129046 ] ASF GitHub Bot commented on CB-7515: Github user rodms10 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-globalization/pull/22#discussion_r17386918 --- Diff: src/firefoxos/GlobalizationProxy.js --- @@ -24,12 +24,25 @@ var GlobalizationError = require('./GlobalizationError'); var l10n_loaded = new Event('l10n_loaded'); var l10n_ready = new Event('l10n_ready'); +var is_l10n_ready = false; + document.addEventListener('l10n_loaded', function() { + console.log('DEBUG: L10n loaded'); --- End diff -- Remove debug logging. > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14128961#comment-14128961 ] Piotr Zalewa commented on CB-7515: -- I have closed the PR as there where about 6 commits difference between apache's repository and github one > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14128950#comment-14128950 ] ASF GitHub Bot commented on CB-7515: Github user zalun closed the pull request at: https://github.com/apache/cordova-plugin-globalization/pull/22 > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CB-7515) Globalization getPreferredLanguage is not calling back
[ https://issues.apache.org/jira/browse/CB-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14128947#comment-14128947 ] ASF GitHub Bot commented on CB-7515: GitHub user zalun opened a pull request: https://github.com/apache/cordova-plugin-globalization/pull/22 CB-7515 [FFOS Globalization] Fix l10n ready event You can merge this pull request into a Git repository by running: $ git pull https://github.com/zalun/cordova-plugin-globalization fix_l10n_ready_event Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-globalization/pull/22.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #22 commit 8c2acbc144417832f384b5638b5caf9a041a812c Author: Staci Cooper Date: 2014-07-02T15:16:02Z CB-6962 Ported globalization tests to framework Tests will not be pulled into project with inclusion of plugin. Pending changes to tooling to run with --test. commit 8533c975c3fb1897958e7b00178f8b1e4a24ed44 Author: Eric Weiterman Date: 2014-07-02T19:35:40Z Added test to complete CB-7064, added tests that check for W3C compliance in language tags generated from PreferredLanguage and GetLocale methods commit c663d4bad3a808ac67b0385005ef0858febd1f3d Author: Staci Cooper Date: 2014-07-29T18:58:41Z Clean-up: removed duplicate code commit 9d7506e514885bbb58881726cf4482c259a30836 Author: Staci Cooper Date: 2014-08-01T20:34:40Z Renamed test dir, added nested plugin.xml commit f4fe4957fea3d95bcba8be34325d37b628a3798a Author: Bryan Higgins Date: 2014-08-14T20:12:27Z CB-7233 [BlackBerry10] Globalization is now supported commit a7a8bd332aa193ddf4c1f1d47622a6f822556e2b Author: Piotr Zalewa Date: 2014-09-10T19:10:24Z fix waiting for an event which was already fired > Globalization getPreferredLanguage is not calling back > -- > > Key: CB-7515 > URL: https://issues.apache.org/jira/browse/CB-7515 > Project: Apache Cordova > Issue Type: Bug > Components: FirefoxOS >Reporter: Piotr Zalewa >Assignee: Piotr Zalewa > > This happens because an ``l10n_read`` event has been fired before calling the > function. -- This message was sent by Atlassian JIRA (v6.3.4#6332)