Generic i18n keys can be used 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.
These generic i18n keys are part of the Magnolia 6 UI framework.
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 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 apply to.
Example: The contact edit form has Save changes and Cancel
buttons.
If your app needs these buttons, just name your
actionscommit and cancel.
Providing a key to other modules or apps
If a key is to be made available to other modules or apps, make the key
less specific by omitting the <module> or <app> part of the key. See
the list below for acceptable shorter forms of i18n keys.
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 needs a
different translation from that used in MTK, the key can be expanded
into a more specific form: