[Dojo-interest] Packaging
Daniel
daniel.carrera at zmsl.com
Sat Dec 22 14:07:51 UTC 2007
It works!!!
Thanks James. You rock.
Tested on FF, IE, Opera & Safari and there are no apparent problems. You
were right about using 'dojo.js' and about how to combine the translation.
Cheers,
Daniel.
James Burke wrote:
> On Dec 21, 2007 2:29 PM, Daniel <daniel.carrera at zmsl.com> wrote:
>>> You can combine dojo.js and layer-A.js into one file by renaming the
>>> first layer in your build to "dojo.js" and putting the layer-A
>>> dependencies in that layer.
>> Interesting. How come it has to be named dojo.js?
>
> So that it adds the modules you want to dojo.js. Once you do this, you
> do not need a layer-A layer definition in the build file. You are
> basically adding extra modules to include with the normal dojo.js
> content.
>
>> I tried joining together dojo.js and layer-A.js but then it couldn't
>> find the translation file. It was weird, it was looking for the file in
>> the directory 'dojo/undefined/nls...' or some such. So clearly some
>> variable became undefined by joining the two files together.
>>
>> So... before I try to join dojo.js with my later I must first make sure
>> I can add the translation to the layer.
>
> Manually combining the layers will not work. The build tool assumes
> module path names based on the layer name to load the i18n bundle for
> a layer. So if you do the "dojo.js" layer in the build profile, you
> should be OK.
>
>> Oh, and what if someone with a different locale uses my application?
>> Does that mean that the app will break in other locales? In my ideal
>> world, I would pack the locales en-us and en-gb only, as that would
>> cover nearly all my users. And the other 1% of users would just get two
>> extra HTTP requests. But I can't have the app break when someone in
>> Poland decides to use it.
>
> If you keep the dojo._preloadLocalizations call in the file and just
> add en-us, en-gb i18n bundle contents before that call, then I expect
> it will work for other countries. But I have not actually tried this
> approach. I'm just making an educated guess.
>
> James
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
More information about the Dojo-interest
mailing list