You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Goal

In Magnolia 5.0, many Strings used in UI are either hardcoded, or used from configuration without i18n. To allow full i18n in M5.1, such Strings have to be replaced by message keys, and the proper i18n code has to be used. This applies especially for the new code, i.e. magnolia_ui, and contacts and dam modules.

Solution

Code

A complete code review is required to identify all places with a direct String output (such as button labels, column headers, etc.). Such places have to be replaced with a proper i18n mechanism (MessagesManager.getWithDefault(key, defaultMsg), where the original String will be used as defaultMsg).

Configuration

After the code review, the configuration (bootstrap) files have to be reviewed, and values of properties label and description (and alternatively others) will be replaced with a proper message key. Such message key (and value) will be added to the messages_en.properties file of the admincentral UI module (or the other module's messages file), and the path of the property + the key will be added to the list of changed properties (one list for each module), which will be then used in the VersionHandler to replace the values on the upgrade.

i18nBasename

In the Magnolia up to 4.5, it is possible to define i18nBasename property in a dialog configuration to define a different message bundle. In Magnolia 5, this still works, just the property has to be placed under the form sub-node of the dialog.

I suggest to allow to use this property also in the app definition, to choose a message bundle for the whole app (actions, workbench, ...). This will require some API extensions, such as adding getI18nBasename() method to the AppDescriptor interface, etc.

 

  • No labels