i18n
ff provides some means to facilitate i18n of websites or projects.
i18n with ffI18n
If you need to provide text in various languages (for ui elements or pre-written content), you can use ff's ffI18n class and functionality.
To use predefined multilingual strings in your application, create a folder system/myPlugin/i18n and place a xml-file in it (all files with the ending .xml will be read).
The system uses the same syntax as the one that is used in .metadata.ff files in content folders:
File buttons.xml
<folder>
<babel version="1.0">
<en_US>
<submit><![CDATA[submit]]></submit>
<cancel><![CDATA[cancel]]></cancel>
</en_US>
<de_DE>
<submit><![CDATA[absenden]]></submit>
<cancel><![CDATA[abbrechen]]></cancel>
</de_DE>
<it_IT>
<submit><![CDATA[invia]]></submit>
<cancel><![CDATA[cancella]]></cancel>
</it_IT>
</babel>
</folder>
You can now access the translated string for "submit" from within ff using ffI18n::get("submit").
25 April 2024