#17424 closed defect (fixed)
i18n.getLocalization fails while another layer is preloading i18n bundles
Reported by: | Brandon Payton | Owned by: | |
---|---|---|---|
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 9 years ago by
Cc: | ben hockey added |
---|
comment:2 Changed 9 years ago by
comment:3 Changed 7 years ago by
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 7 years ago by
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 7 years ago by
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.
comment:6 Changed 7 years ago by
Any updates on this issue or any workarounds I can use? We are running short on time.
comment:7 Changed 7 years ago by
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 7 years ago by
Milestone: | tbd → 1.12 |
---|
comment:9 Changed 6 years ago by
Milestone: | 1.13 → 1.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 6 years ago by
Milestone: | 1.15 → 1.12 |
---|
comment:11 Changed 6 years ago by
Owner: | set to Dylan Schiemann <[email protected]…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In 0db1d3e/dojo:
comment:15 Changed 6 years ago by
Milestone: | 1.12 → 1.9.10 |
---|
Hi, I think I'm experiencing the same issue in v 1.8.0 with dojo build. I have several layers: 'dojo/dojo': {
}, '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.