Opened 8 years ago

Closed 8 years ago

#14211 closed defect (fixed)

dojo/i18n doesn't load dojo/xhr (but it needs to)

Reported by: bill Owned by: ben hockey
Priority: high Milestone: 1.7.1
Component: Internationalization Version: 1.7.0
Keywords: Cc: Rawld Gill, Adam Peller
Blocked By: Blocking:

Description (last modified by bill)

dojo.requireLocalization() ends up calling dojo.xhr() but without loading the dojo/_base/xhr.

Apply attached patch to make i18n.js baseless, and then run util/doh/runner.html?test=dojo/tests/date/locale, which does a dojo.requireLocalization() call. It will get an exception.

The issue is that i18n.js has a dependency:

"./has!dojo-v1x-i18n-Api?./_base/xhr"

but dojo-v1x-i18n-Api isn't defined until later in that i18n.js file:

has.add("dojo-v1x-i18n-Api",
	// if true, define the v1.x i18n functions
	1
);

Chicken and egg problem.

Broke in [25690] so assigning to Ben.

Attachments (1)

i18n_baseless.patch (2.4 KB) - added by bill 8 years ago.
patch moving towards i18n.js being baseless (but it still has some dojo references)

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by bill

Attachment: i18n_baseless.patch added

patch moving towards i18n.js being baseless (but it still has some dojo references)

comment:1 Changed 8 years ago by bill

Description: modified (diff)

comment:2 Changed 8 years ago by bill

In [26965]:

Modifying files that call lang.getObject("foo", true, dojo) to remove unneeded references to dojo variable, refs #13959 !strict.

Skipping i18n.js since it has a dojo.xhr() missing dependency issue, refs #14211.

comment:4 Changed 8 years ago by ben hockey

In [26968]:

since r26879 fixed the unguarded reference to window, there's no longer a need
to conditionally load xhr. refs #14211 !strict

comment:5 Changed 8 years ago by ben hockey

bill, should r26968 be enough to close this ticket?

comment:6 Changed 8 years ago by bill

Yes, after it's backported to the 1.7 branch.

There's still the issue of converting i18n.js to baseless, which I'll do on trunk, and also a missing reference to dojo/_base/config, but that missing reference is benign since kernel.js pulls in config.js.

Last edited 8 years ago by bill (previous) (diff)

comment:7 Changed 8 years ago by bill

In [26969]:

Updates i18n.js module to not use dojo global variable, except for exporting the module's symbols. Refs #14220, #14211 !strict. Apparently it's no good to reference config.locale, (tests/date/locale fails), so still referencing dojo.locale. That should be fixed at some point.

comment:8 Changed 8 years ago by ben hockey

Resolution: fixed
Status: newclosed

In [26979]:

applying r26968 to 1.7 branch. fixes #14211 !strict

Note: See TracTickets for help on using tickets.