Database translations - xaraya/core GitHub Wiki

Database content in general is not meant to be translated. For instance, rather than translate articles or publications on the fly, it makes more sense to store a different language version of the content in question in the database. In some cases however, such as (to take an example) dropdowns using database content, it would be nice to have such translations.

We are currently working on enabling translations for content from the database. These translations work the same way as other translations, that is, they are entered using the translations module. File translations are triggered by xarML calls in the PHP code, or simply any text nodes in the templates. For database translations, we flag translatable content by designating dataproperties as translatable. This is done in the dynamicdata backend, in the definition page of each dataobject. The translations are then automatically called when the content of such properties is displayed through the property's showOutput method.

The translations module has been updated to take into account dataobjects and their translatable properties.

Using database translations is currently recommended only for development sites.

For installs after August 1, 2017 this feature is already included in the core.

For older installs upgrading to the latest code, the following SQL needs to be executed in phpMyAdmin on your database:

ALTER TABLE `xar_dynamic_properties` ADD `translatable` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `source`