Opened 6 years ago

Closed 3 years ago

Last modified 3 years ago

#17424 closed defect (fixed)

i18n.getLocalization fails while another layer is preloading i18n bundles

Reported by: Brandon Payton Owned by: Dylan Schiemann <dylan@…>
Priority: undecided Milestone: 1.9.10
Component: Internationalization Version: 1.9.1
Keywords: Cc: ben hockey
Blocked By: Blocking:

Description

In a built application, calls to i18n.getLocalization fail while another layer is preloading i18n bundles. The culprit is this bit of the load function which is called by getLocalization: https://github.com/dojo/dojo/blob/1f53266a1cacdd59b546f20eb1f1b478df87cea2/i18n.js#L258-L260

While another layer is preloading waitForPreloads returns a non-zero, truthy value leading to a premature return for the purposes of getLocalization.

Change History (15)

comment:1 Changed 6 years ago by ben hockey

Cc: ben hockey added

comment:2 Changed 6 years ago by fearnor

Hi, I think I'm experiencing the same issue in v 1.8.0 with dojo build. I have several layers: 'dojo/dojo': {

include: [ 'dojo/dojo', 'dojo/domReady', 'dojo/_base/lang', 'dojo/i18n', 'dojo/date/locale'], boot: true, customBase: true

}, 'main/application/Application': { ... } 'main/section/landing/LandingSection': { ... } 'main/section/channels/ChannelsSection': { ... }

At the begining I load the dojo and the Application layers, then I load either LandingSection? or ChannelsSection? layer - everything works fine until this point. Then I dynamically load the other layer (ChannelsSection? or LandingSection?). Both ChannelsSection? and LandingSection? layers depend on dijit/layout/ContentPane. After the layer is loaded and DoJo? lifecycle kicks in ContentPane? calls i18n.getLocalization("dijit", "loading", this.lang) which returns undefined which causes an exception and my app stops working. I debugged the issue and it got to the same point as the issue reporter.

comment:3 Changed 4 years ago by gorgoroth

This problem is quite urgent. I have dojo version 1.8.3. The application main layer is loaded with "deps" configuration in dojo config. When the application starts, some data is requested from the server and some widgets are instantiated (these widgets inherit from dijit/layout/ContentPane). Meanwhile another layer, which uses i18n, is requested by the application. The call to i18n.getLocalization() inside dijit/layout/ContentPane::postMixinProperties() returns undefined. Maybe the cause is the second layer which is being requested and parsed while the ContentPane? widgets are being instantiated. Should this be the cause, the solution is not that simple because the two processes (widgets instantiation and layer request) should be synchronized.

comment:4 Changed 4 years ago by ksbhanda

I also see this problem and I am running dojo 1.10.4. When the application starts, some data is requested from the server and some widgets are instantiated (these widgets inherit from dijit/layout/ContentPane). Everything loads fine and then we load other content, that uses another dojo layer, which uses i18n. At the same time we get back data from our ajax call and we re-load the first widgets. The call to i18n.getLocalization() inside dijit/layout/ContentPane::postMixinProperties() returns undefined. Which causes the widgets to fail loading. Is there a workaround for this issue?

comment:5 Changed 4 years ago by gorgoroth

I tried to disable the "dojo-preload-i18n-Api" feature inside the build profile: the result is worse. Discarding the idea to synchronize the two layers (a nightmare), the only workaround is to merge the two layers in a single one. Of course this invalidates the idea of having separate layers for the application. I hope dojo developers will find a solution as soon as possible.

Last edited 4 years ago by gorgoroth (previous) (diff)

comment:6 Changed 4 years ago by ksbhanda

Any updates on this issue or any workarounds I can use? We are running short on time.

comment:7 Changed 4 years ago by dylan

The people with the greatest interest in this seem to be unresponsive at the moment. If you truly need an urgent fix, http://www.sitepen.com/support is an option to consider. Otherwise I'm sure the community will get to it eventually, but there are many high priority things being worked on currently also so I don't have an estimated date for a fix.

comment:8 Changed 4 years ago by dylan

Milestone: tbd1.12

comment:9 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

comment:10 Changed 3 years ago by dylan

Milestone: 1.151.12

comment:11 Changed 3 years ago by Dylan Schiemann <dylan@…>

Owner: set to Dylan Schiemann <dylan@…>
Resolution: fixed
Status: newclosed

In 0db1d3e/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:12 Changed 3 years ago by Dylan Schiemann <dylan@…>

In 1df0761/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:13 Changed 3 years ago by Dylan Schiemann <dylan@…>

In 8625da7/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:14 Changed 3 years ago by Dylan Schiemann <dylan@…>

In 9205adf/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:15 Changed 3 years ago by dylan

Milestone: 1.121.9.10
Note: See TracTickets for help on using tickets.