-
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.
- davinci/actions/SelectThemeAction.js
- davinci/actions/OpenThemeEditor.js
- davinci/ve/input/BorderContainerInput.js
- davinci/ve/input/DataGridInput.js
- davinci/actions/saveAsWidget.js
- davinci/ui/SaveAsWidgetForm.js
- davinci/ve/palette -- common.js
- davinci/ve/prefs -- common.js
###Files that don't appear to be used yet
- Some of the files in davinci/ve/widgets (like Background.js and Border.js) don't seem to be used outside of this widgets folder. They look like they might one day be used in davinci/ve/views/SwitchingStyleView.js
- davinci/ve/actions/ChildActions.js
- davinci/Workbench.js -- "Select Editor" -- commented out and edited
- davinci/Runtime.js -- "Careful! You are about to leave daVinci." -- globalized
- davinci/ve/Context.js -- "Careful! You are about to leave Maqetta." -- commented out
- Strings in ui/Panel.js-- strings aren't used, and they're noted as such though not commented out
- Strings in ve/HTMLVisualEditor.js -- commented out since the strings since no longer used
###templates that aren't used
- ui/templates/downloadSelected.html
I've marked things I believe I have completed -- unless I missed a string somewhere.
SwitchingStyleView.js -- the Properties palette-
Files in the widgets foldersuch as Background.js, Border.js, BorderRadius.js, etc. (didn't actually do Background.js, Border.js and BorderRadius.js in ve/widgets/ since they're currently not being used, but I did the others)
The palettes on the left and right side of the Maqetta user interface
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.jsFiles containing alerts, prompts and dialogs such as newTheme.js, Runtime.js, StateActions.js, BorderContainerInput.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 stringsdavinci.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
###Templates
- ui/templates/*.html
###Need to study the davinci.core/WebContent/eclipse/* folder
-
to see if anything there needs to be localized-- doesn't look like there is
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
...
To be determined -- Most likely OpenAjax's syntax for message bundle files in xml or json
Globalization postponed until a later date.
- SwitchingStyleView.js -- the Properties palette
- Background.js -- the Background properties
The palettes on the left and right side of the Maqetta user interface