Skip to content
JonFerraiolo edited this page Jun 14, 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.

Localization Inventory (Incomplete)

Maqetta palettes

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

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

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

###Widget metadata helper files

  • Need to inventory *helper.js files in the metadata folders

###Smart input helper files

  • davinci.core/WebContent/davinci/ve/input/* - I see a string in DataGridInput.js, probably other files also have strings

###Theme metadata (e.g., davinci.dojo_1_7/WebContent/maqetta/themes/claro/*)

  • *.theme files (e.g., claro.theme)
  • *.json files (e.g., claro.json)

###Main file

  • davinci.core/WebContent/pagedesigner.html might have a couple of strings

###Review and commenting (davinci.review project)

  • davinci.review/WebContent/review.html might have a couple of strings

###Mobile previewer code

  • davinci.core/WebContent/preview.html might have a couple of strings
  • davinci.core/WebContent/preview/singlepreview.js has a couple of strings

###Various files need to be totally replaced for localized versions

  • All of the welcome.html files
  • All of the welcome_to_maqetta.html files (e.g., davinci.core/WebContent/ve/resources/welcome_to_maqetta.html)
  • davinci.core/WebContent/workspace/app.css
  • Localized davinci.core/WebContent/samples/*.html? Probably not, but would be good to have things set up so that product teams could have localized versions if they so wanted

###Need to study the davinci.core/WebContent/eclipse/* folder

  • to see if anything there needs to be localized

Maqetta Palettes and Maqetta Dialogs

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  
...

Widget Metadata

To be determined -- Most likely OpenAjax's syntax for message bundle files in xml or json

Maqetta Plugins

Globalization postponed until a later date.

Where to Begin the Globalization Process

Maqetta palettes

  • SwitchingStyleView.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