translationSource

translationSource
Path

$GLOBALS['TCA'][$table]['ctrl']

type

string (field name)

Scope

Proc. / Display

Name of the field, by convention l10n_parent is used by translations to point back to the original record (i.e. the record in any language from which they are a translated).

This property is similar to transOrigPointerField. Both fields only contain valid record uids (and not 0), if the record is a translation (connected mode), and not a copy (free mode). In connected mode, while "transOrigPointerField" always contains the uid of the default language record, this field contains the uid of the record the translation was created from.

For example, if a tt_content record in default language English with uid 13 exists, this record is translated to French with uid 17, and the Danish translation is later created based on the French translation, then the Danish translation has uid 13 set as l18n_parent and 17 as l10n_source.

Example

EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php
<?php

return [
    'ctrl' => [
        'transOrigPointerField' => 'l18n_parent',
        'transOrigDiffSourceField' => 'l18n_diffsource',
        'languageField' => 'sys_language_uid',
        'translationSource' => 'l10n_source',
        // ...
    ],
    'columns' => [
        'sys_language_uid' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
            'config' => [
                'type' => 'language',
            ],
        ],
        'l18n_parent' => [
            'displayCond' => 'FIELD:sys_language_uid:>:0',
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => [
                    [
                        '',
                        0,
                    ],
                ],
                'foreign_table' => 'tx_myextension_domain_model_something',
                'foreign_table_where' =>
                    'AND {#tx_myextension_domain_model_something}.{#pid}=###CURRENT_PID###'
                    . ' AND {#tx_myextension_domain_model_something}.{#sys_language_uid} IN (-1,0)',
                'default' => 0,
            ],
        ],
        'l10n_source' => [
            'config' => [
                'type' => 'passthrough',
            ],
        ],
        'l18n_diffsource' => [
            'config' => [
                'type' => 'passthrough',
                'default' => '',
            ],
        ],
        // ...
    ],
];
Copied!