Book Image

Learning Dojo

By : Peter Svensson
Book Image

Learning Dojo

By: Peter Svensson

Overview of this book

<p>Dojo is a popular AJAX-specific open-source JavaScript framework for building powerful web applications. It provides a well conceived API and set of tools to assist you and fix the issues experienced in everyday web development. Your project size is no concern while using Dojo. It is the best scalable solution to all your size-related issues.<br /> <br />This book starts by giving you tips and tricks for programming with JavaScript. These tricks will help you with Dojo. With every chapter, you will learn advanced JavaScript techniques. You will learn to leverage Dojo for a clean web application architecture using JSON or XML.</p>
Table of Contents (13 chapters)
Learning Dojo
Credits
About the Author
About the Reviewer
Preface
Free Chapter
1
Introduction to Dojo

I18N


Dojo uses Internationalization in all the official widgets under the dojo and dijit hierarchies. Only functionality in the experimental dojox hierarchy is exempt from I18N compliance.

Dojo uses specific JavaScript files for each function and language, so that it is comparatively simple to add translations and handling for locales which are not yet supported.

djConfig.locale

By setting the djConfig.locale variable, you can change the look and feel of Dojos widgets to better conform with other locales than en_us.

All Dijits that have some kind of semantic responsibility can and will show different behavior when a locale other than default is set.

Under the dijit folder in the Dojo directories, there's a folder called nls. In this folder, Dojo has put JavaScript files containing an object literal with resource strings for the classes with the same names.

As an example, there's a file called loading.js with the following content:

({
loadingState: "Loading...",
errorState: "Sorry, an error occurred...