Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.
This page describes selected best practices within the context of i18n API.
Use message bundles
. It makes translation easier. A translator can work with a plain text file and doesn't need to touch the code. A message bundle is a collection of
.properties files. Each file contains key-value pairs of translated user interface text such as labels and messages. The keys in all
.properties files of the same bundle are identical but the values are language specific translations.
Recommended filename structure
We recommend the following i18n filename patterns, for apps and modules, respectively:
Use Java locale notation for <locale>
Keep your message bundles in the following folders:
src/main/resources/<module-name>/i18n/(Maven module development) or in
Use generic i18n keys
Whenever possible (see here for more details and restrictions), use generic, i.e. shorter i18n keys. The shorter the form, the more modules will exist where the key can be instantly reused.
Use UTF-8 encoding
Use UTF-8 character encoding in
Keep a separate file for template messages
Example: Message files in the Travel Demo