-
Notifications
You must be signed in to change notification settings - Fork 0
Globalization
#Globalization
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.
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.
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.require("dojo.i18n");
dojo.requireLocalization("directory.containing.nls.folder","resourceBundleName");
dojo.i18n.getLocalization("directory.containing.nls.folder","resourceBundleName");
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
...
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.
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.
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
- SwitchingStylingView.js -- the Properties palette
- Background.js -- the Background properties
The palettes on the left and right side of the Maqetta user interface