Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MOTION-157

...

Note

These generic i18n keys have been deprecated since Magnolia 6.0. They are part of the Magnolia 5 UI framework.

For the updated implementations, see Generic i18n keys for Magnolia 6 UI instead.

This page explains the use of generic Generic i18n keys , which can be used simultaneously in more than one location simultaneously, such as in multiple modules, apps and subapps, tabs or views. A list of such keys is provided at the end of this page.

...

At startup, Magnolia creates a global message bundle by reading keys from all .properties files of all modules in the current project. The global bundle is a virtual bundle, not a physical file. It includes keys from your module and keys from Magnolia's own modules such as ui-admincentral and ui-framework.

This means that you do not need not need to provide keys for all UI elements in your app. Keys for commonly reused elements such as buttons and subapps are in Magnolia's own modules. Just reuse the UI element in your app, and Magnolia will find the existing key automatically. In simple terms, the shorter the form of the key, the more places it will be applicable apply to.

Example: The contact edit form has two buttons:  Save Changeschanges and Cancel: buttons.

The Contacts app does not provide the text for either button in its own message bundle. They are provided in the module-ui-framework-messages_en.properties file of the ui-framework module.

...

Therefore, it is not necessary to insert two specific keys such as the following into the .properties file of the Contacts app:.

Code Block
languagepowershell
titlecontacts-app-messages_en.properties
contacts-app.actions.commit=save changes
contacts-app.actions.cancel=cancel

If your app needs these buttons, just name your actions commit and cancel.

...

enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

...

Mgnl n
actions

...

Mgnl n
commit

...

Mgnl p
class

...

info.magnolia.ui.form.action.SaveFormActionDefinition

...

Mgnl p
implementationClass

...

info.magnolia.contacts.app.form.action.SaveContactFormAction

...

Mgnl n
cancel

...

Mgnl p
class

...

Image Added

Providing a key to other modules or apps

...

There are, however, scenarios when a translation for an element has to be different from the one available in the generic key. In this case, the user still has the option to expand the key from its short (generic) form into a longer pattern that specifies the element (e.g. the module, app, subapp, etc.) where the translation should appear. For example, if the key for the teaser component in the Travel Demo module needed needs a different translation from that used in MTK, the key can be expanded into a more specific form:

...

(warning) If used in the key, <subapp> requires <app>.

...

Tabs

  • <module>.<dialogPath>.<tab>[.label]
  • dialogstabs.<dialogPath><tab>[.label]

...

Dialogs

  • <module>.<dialogPath>.<tab>[.label]
  • tabsdialogs.<tab><dialogPath>[.label]

Fields

  • [<module>.]<dialogPath>.[<tab>.]<field>[.label]
  • [<module>.]<dialogPath>.[<tab>.]<field>.description
  • <tab>.<field>[.label]
  • <tab>.<field>.description
  • fields.<field>[.label]
  • fields.<field>.description

Field validators

The generic i18n key form for a field validator is validators.<validatorName>.errorMessage.

...

  • [<module>.]<dialogPath>.[<tab>.]<field>.validation.errorMessage
  • <tab>.<field>.validation.errorMessage
  • fields.<field>.validation.errorMessage

Templates

Pages/components

    • [<module>.]templates.<templatePath>
    • [<module>.]templates.<templatePath>.description

Areas

    • templates.areas.<areaName>
    • templates.areas.<areaName>.description