This page describes selected best practices within the context of i18n
API.
Use message bundles
Provide a message bundle in your module. 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:
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 .properties files.
Separate message bundles
Create separate message bundles for user interface labels and template labels.
Don’t store these two groups of text in the same properties files or message bundles.
They are aimed at different audiences and have different localization requirements.