Table Configuration
deepltranslate_core supports the translation of specific fields of TCA records.
It only understands fields to be translated only if their l10n_
is set to prefix.
Attention
deepltranslate_core only translates fields defined as TCA type
input or text. Other fields cannot currently be translated automatically
due to limitations in the DataHandler.
deepltranslate_core uses a DataHandler hook to detect translatable fields.
The following setup is required to make deepltranslate_core work on your table:
<?php
$GLOBALS['TCA']['<table_name>']['columns']['<field_name>']['l10n_mode']
= 'prefixLangTitle';
$GLOBALS['TCA']['<table_name>']['columns']['<another_field_name>']['l10n_mode']
= 'prefixLangTitle';
Content Blocks
Fields defined with Content Blocks follow the same rule. Content Blocks
sets no l10n_ on its own, so DeepL does not translate a field of a
Content Block until its YAML definition sets l10n_.
A field without it is copied to the translation unchanged.
name: vendor/teaser-boxes
fields:
- identifier: header
useExistingField: true
- identifier: teaser
type: Textarea
l10n_mode: prefixLangTitle
- identifier: boxes
type: Collection
labelField: title
fields:
- identifier: title
type: Text
l10n_mode: prefixLangTitle
- identifier: text
type: Textarea
enableRichtext: true
l10n_mode: prefixLangTitle
- Set
l10n_on every field of the typesmode: prefix Lang Title TextandTextareathat DeepL should translate. Content Blocks writes it into the TCA column of the field, the same as the PHP override above. - The fields of a
Collectionneed it as well. The records of aCollectionare translated together with the record they belong to. - A field reused with
usekeeps theExisting Field: true l10n_of the existing column, Content Blocks ignores the option for it. TYPO3 configuresmode headerandbodytextoftt_withcontent prefix, and deepltranslate_core addsLang Title subheader. Any other existing field needs the PHP override above.
Note
Content Blocks supports l10n_ in this way since version 1.1.0.
See the option l10n_mode in the documentation of Content Blocks.