I've recently observed some strange behaviour with built version of my dojo applications. Some buttons have 'undefined' label. Such behaviour exists only in the version built by Dojo Build.
After exact inspection it happens, that the first call is returning "undefined", and the subsequent calls return the correct messages object.
However, to make things even more interesting, subsequent calls within the same 'require' are still returning undefined. So following snipplet in Firebug Console:
require(["dojo/i18n"],function(i18n){
for (var i in [1,2])
console.log(i18n.getLocalization("app.ui.widgets", "dialogs", "de"))
})
prints 'undefined' at the first call, at the second, however, gives the values back.
My nls/dialogs.js
:
define({ root:
//begin v1.x content
({
tooMuchElements: "Too many elements. Only the first ${N} are shown.",
}),
//end v1.x content
"de": true,
});
My nls/de/dialogs.js
:
define(
({
tooMuchElements: "Zu viele Elemente. Nur erste ${N} sind gezeigt.",
})
);
Without build, everything functions correctly. What can be the issue here? Is it some bug in build, or it is somehow expected behaviour, and I need to make some 'extra' initializations while using build?
I'm using Dojo 1.9.2.