ICU Resource Bundles and MessageFormat
Support for ICU MessageFormat and ICU Resource Bundles has been added. These are both part of Unicode's ICU project, but they are otherwise unrelated features.
Resource Bundles
You can now import and export Resource Bundles in binary and source formats:
The binary format is exported by specifying the
.res
extension. This format can be read by many platforms including PHP's Intl extension. Loco exports format version 2.0. If you need a different version, download the source format and compile it with thegenrb
command line tool.The source format is exported by specifying the
.txt
extension. It tends not to be readable by web application frameworks, but is useful for debugging.
See the ICU User Guide for more information.
MessageFormat
ICU MessageFormat has been added to the string formatting styles that Loco understands.
Translations in this format will be validated and highlighted within the editor. The screenshot below shows a pluralized message in the management view. Note the code view is enabled for the syntax highlighting to work:
Any source text that validates as MessageFormat will automatically set the asset's formatting property to
"icu"
(unless it is already something else). If this is undesirable, you can disable it. See Changing the asset property.Along with the regular "printf" styles already supported, some conversion of syntax can be performed at export.
See Working with string formatting across platforms.As MessageFormat supports plurals, a tool has also been added to help initialize plural forms from your locale settings.
See Managing pluralized translations.
Minor API changes
Version 1.0.21
of the API is released. See changelog.