Skip to content
cindyskach edited this page Jun 6, 2011 · 24 revisions

#Globalization

About This Page

Contains a proposal on how to approach Globalization for the Maqetta code base so that localized strings can be used instead of the current hard-coded English strings.

Setting the Locale

While it was suggested not to decide this right now, two possible solutions are available here for setting a locale. Based on the information on that site, if no locale is specified then the default locale of the browser will be used, which is probably not a good approach in the long run.

Creating Resource Bundles

Resource bundles will be written in the JSON format. Each resource bundle pertaining to each locale will be in its specific locale folder. These locale folders will be contained in a folder named "nls"

Dojo Commands to Extract Localized Info

dojo.require("dojo.i18n");
dojo.requireLocalization("directory.containing.nls.folder","resourceBundleName");
dojo.i18n.getLocalization("directory.containing.nls.folder","resourceBundleName");

Implementation

Going off of some of Adam Peller's Dojo documentation found here, the basic idea will be to assign the localized resources returned by dojo.i18n.getLocalization to an object. We could then access the appropriate resources through the object.

If we were to localize the strings in the Properties Palette and store them in a Resource Bundle called "common," the code might look something like:

dojo.require("dojo.i18n");  
dojo.requireLocalization("davinci.ve", "common");  
var langObj = dojo.i18n.getLocalization("davinci.ve", "common");  
...  
{title:langObj.common,//the title would then be "Common" if in English  
...  
{title:langObj.widgetSpecific,//the title would then be "Widget-specific" if in English  
...

Localization Inventory (Incomplete)

Maqetta palettes

The palettes on the left and right side of the Maqetta user interface

  • SwitchingStylingView.js -- the Properties palette
  • Files in the widgets folder such as Background.js, Border.js, BorderRadius.js, etc.

Maqetta plugins

ui_plugin.js, ve_plugin.js, review_plugin.js, themeEditor_plugin.js
These files contain the strings the user sees the most when using Maqetta.

Maqetta dialogs

File dialogs in Resource.js
Files containing alerts, prompts and dialogs such as DragSource.js, newTheme.js, StateActions.js, BorderContainerInput.js, Runtime.js, AddLinkActions.js, etc. ###Widget metadata

  • widgets.json
  • *_oam.js files

Where to Begin the Globalization Process

Maqetta palettes

  • SwitchingStylingView.js -- the Properties palette
  • Background.js -- the Background properties
    The palettes on the left and right side of the Maqetta user interface

Maqetta dialogs

Clone this wiki locally