8.2.5 Workflow process internationalization
All <label> and <description> elements in the Daisy process metadata can contain either a fixed label or description or a key which will be used to lookup the label in a resource bundle. If a key is intended, add an attribute i18n="true" on the label or description element, for example:
<label i18n="true">variable.document.label</label>
i18n is short for "internationalization" (because there are 18 characters left out between the i and the n)
The resource bundles should be placed in the i18n subdirectory of the process archive. Their naming structure is as follows:
<basename>_<language>_<country>_<variant>.xml
The language, country and variant are all optional. These are some examples of valid names for the basename "messages":
messages_nl_BE.xml messages_nl.xml messages.xml
When a value needs to be retrieved from a resource bundle, Daisy will search
all resource bundles in the order as listed in the
<resourceBundles> tag in the
So if the user's locale is nl_BE, Daisy will first look in messages_nl_BE.xml, if this file doesn't exist or the key is not found there then it will look in messages_nl.xml, and finally in messages.xml. Then the next set of bundles will be searched (if any). The purpose of multiple sets of bundles is to easily reuse sets of keys in different process archives.
Instead of the standard Java property file format, we have opted for an XML-based resource bundle format since this is more familiar and provides more comfortable encoding support. The format used is the same as Apache Cocoon's bundles (used in the Daisy Wiki), which is something like this:
<catalogue> <message key="...">...</message> [... more message elements ...] </catalogue>
The <message> elements can contain "mixed content" (= a mix of text and other elements), such as:
<message key="my.description">This is an <b>important</b> thing.</message>
Previous