Opened 8 years ago

Closed 5 years ago

Last modified 5 years ago

#16451 closed defect (patchwelcome)

NLS resources fail to load on Windows apps

Reported by: Paul Christopher Owned by:
Priority: undecided Milestone: 1.13
Component: Internationalization Version: 1.8.1
Keywords: metro Cc: Rawld Gill, Clement Mathieu
Blocked By: Blocking:

Description (last modified by bill)

Broken out from #16432...

NLS files do not load correctly for Windows 8 applications using dojo.

For the test case in #16432, the i18n code tries to load dojo/cldr/nls/gregorian. injectUrl() inserts this into the document:

<script src="/js/dojo/cldr/nls/gregorian.js" type="text/javascript"></script>

Then def() a.k.a. define() gets called, but with the contents of dojo/cldr/nls/en/gregorian.js.

It appears to be due to the NLS support built in to the platform, see

It can be demonstrated more simply via:

require(["dojo/cldr/nls/gregorian"], function(gregorian){ ... });

That will fail looking for a non-existant dojo/cldr/nls/en-us/gregorian.js file.

Change History (12)

comment:1 Changed 8 years ago by bill

Description: modified (diff)

comment:2 Changed 8 years ago by Adam Peller

Cc: Rawld Gill added

I don't have access to a windows 8 system and the MSDN ref is unclear to me. Is it doing some file I/O magic simply because there's /en/ in the path? Windows 8 doesn't require any sort of manifest before it makes substitutions? That sounds pretty broken.

comment:3 Changed 8 years ago by bill

Owner: Adam Peller deleted
Reporter: changed from bill to Paul Christopher
Status: newassigned

There is an auto-generated manifest but it doesn't mention anything about mappings. AFAICT it's automatic.

I didn't mean for this to necessarily get assigned to you. I wrote to see if anyone has any ideas, but nothing so far.

I'm sure an app developer could workaround the issue by doing a build that included all the resource files, or at least all the root files.

Unfortunately more transparent solutions like <script src="..." lang=""> don't seem to work.

comment:4 Changed 8 years ago by Paul Christopher

Bill, should I file a ticket on that on Microsoft's bug tracker and ask for a parameter/tag that turns off automatic file mapping? Or can we workaround that? I couldn't find a way to switch off Microsoft's automatic i18n file remapping functionality...

comment:5 Changed 8 years ago by Adam Peller

Paul, the docs weren't clear to me, but if that's what's happening, it's bound to break existing apps and should be reported as a bug. This mapping should be off by default, IMO.

comment:6 Changed 8 years ago by bill

I wouldn't classify it as a bug (after all, it's a documented feature), but sure, try filing a ticket, maybe that will help get a response about how to disable this behavior.

comment:8 Changed 7 years ago by bill

Presumably you could work around the issue by putting the root locale file (ex: dojo/cldr/nls/gregorian) into the build, and maybe also the specific locale that you are using. See also #16761.

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

comment:9 Changed 7 years ago by cjolif

Keywords: metro added

comment:10 Changed 6 years ago by cjolif

Cc: Clement Mathieu added

comment:11 Changed 5 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: assignedclosed

Given no response from MS, I don't see a way to fix this beyond the suggestions made earlier in the ticket. So it looks like we'll close it as patchwelcome, should a solution emerge in the future.

comment:12 Changed 5 years ago by dylan

Given that no one has shown interest in creating a patch in the past 2+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.