Changes between Version 1 and Version 2 of Ticket #16432, comment 16


Ignore:
Timestamp:
Dec 10, 2012, 7:16:10 AM (9 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16432, comment 16

    v1 v2  
     1(edited reply based on further research)
     2
    13Replying to [comment:14 Paul Christopher]:
    24> When trying to load the dojo/cldr/nls/en/gregorian bundle, a "/x" is added to the mid path by dojo.js toURL method. So the new mid path in dojo.js getModuleInfo is "dojo/cldr/nls/en/gregorian.js/x". Maybe that is the cause, why the instantiation of the !DateTextBox fails...
     
    46Hmm, well there definitely seems to be a problem loading the NLS resources.   I did see that /x thing but it might be a red herring.
    57
    6 Before loading a language/locale specific module like dojo/cldr/nls/en/gregorian, the i18n code loads the root file, dojo/cldr/nls/gregorian, in order to find out what language/locale specific modules exist.    And according to my debugging, {{{require(["dojo/cldr/nls/gregorian"])}}} is returning something slightly wrong: instead of {{{ { root: { ... } } }}} it's just returning the inner {{{ { ... } }}}.   This is in the doLoad() method of i18n.js.
     8Before loading a language/locale specific module like dojo/cldr/nls/en/gregorian, the i18n code loads the root file, dojo/cldr/nls/gregorian, in order to find out what language/locale specific modules exist.
    79
    8 So gregorian.js looks like this in trunk:
    9 
    10 {{{
    11 define({ root:
    12 
    13 //begin v1.x content
    14 {
    15         "days-standAlone-short": [
    16 ...
    17 }}}
    18 
    19 and yet when it's loaded dynamically it looks like:
    20 
    21 {{{
    22 define(
    23 //begin v1.x content
    24 {
    25         "dateFormatItem-Ehm": "E h:mm a",
    26         "days-standAlone-short": [
    27 ...
    28 }}}
    29 
    30 This is easy to see in the debugger by setting a breakpoint in the def() method, and then looking up the call stack to the function that called def(), listed as "gregorian.js [dynamic]".   It's loaded when injectUrl() inserts this into the document:
     10Dojo/cldr/nls/gregorian is loaded when injectUrl() inserts this into the document:
    3111
    3212{{{
     
    3414}}}
    3515
     16Then def() gets called, but with the contents of cldr/nls/'''en'''/gregorian.js.
    3617
     18This is easy to see in the debugger by setting a breakpoint in the def() method, and then looking up the call stack to the function that called def(), listed as "gregorian.js [dynamic]".
     19
     20From there problems start to happen because root.root is undefined for the English version of gregorian.js.