Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
titlemodule-ui-framework-messages_en.properties
# Default Action Labels
actions.commit=save changes
actions.cancel=cancel

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

...

If a key is to be made available to other modules or apps, make the key less - specific , i.e. shorten it, usually by omitting the <module> or <app> part of the key. See the list below for acceptable shorter forms of i18n keys.

Example: The key for the Teaser teaser component in the MTK module (https://demo.magnolia-cms.com/.magnolia/admincentral;#app:resources:detail;/mtk/templates/components/teaser.yaml) 

Code Block
languagehtml/xml
mtk.templates.components.teaser=Teaser

...

By omitting the module name (mtk) in from the key, the shorter form can be reused for translation in other modules, e.g. in the Travel -demo Demo (https://demo.magnolia-cms.com/.magnolia/admincentral;#app:resources:detail;/travel-demo/templates/components/teaser.yaml).

...

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 which that specifies the element (ie.eg. the module, app, subapp, etc.) where the translation should appear. For example, if the key for the Teaser teaser component in the Travel -demo Demo module needed a different translation than from that used in MTK, the key can be expanded into a more specific form:

...

The translation will now be available primarily to the teaser component in the Travel Demo module.

...