[Dojo-interest] buliding in nls resources?

James Burke jburke at dojotoolkit.org
Wed Feb 21 14:44:20 MST 2007

On 2/21/07, Meng Mao <mengmao at gmail.com> wrote:
> According to the end of the "Localizing Strings" section of
> the page on Internationalization
> (http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book80
> ),
> dojo.requireLocalization("dojo.widget", "validate", "ja");
> will look for validate.js in the path:
>  src/widget/nls/ja/
> This is when dojo hasn't been built into a monolithic script yet.
> By examining the built version, I can see that translated strings will end
> up
> in the dojo/nls folder, where each language has an associated
> dojo_<locale>.js file.
> I can't seem to find the documentation that explains the process by which
> some translated resources are sucked into the appropriate dojo_<locale>.js.
> Can anyone point me the way, or explain how this is done?
> Currently, I just manually hack dojo_<locale>.js to include the bundles and
> namespace provides,
> but I want to know how it should be done the right way.

Just do custom build and include the modules that call
dojo.requireLocalization() as part of the build dependencies in your
build's profile.js file. Any bundles that are references in the built
dojo.js file will have the i18n resources put in the dojo_<locale>.js

Also note that as of Dojo 0.4.1, the custom build will flatten the
individual bundles in their nls directories, so that there is only one
request done for the resource (and not many bundle requests for each
step in the locale tree).


More information about the Dojo-interest mailing list