languageField

languageField
Type
string (field name of type language)
Path
$GLOBALS['TCA'][$table]['ctrl']
Scope
Proc. / Display

Changed in version 13.3

This property contains the column name of the column which contains the identifier language of the record. The column definition is auto-created. If it is overridden it must still be of type Language fields.

The column is called sys_language_uid by convention.

Backend users can be limited to have edit access for only certain of these languages and if this option is set, edit access for languages will be enforced for this table.

Also see the Frontend Localization Guide for a discussion about the effects of this property (and other TCA properties) on the localization process.

Migration: Remove language column definitions from TCA

On dropping TYPO3 v12.4 support extensions authors can drop the column definitions of the language fields. They need to keep the Grouping fields (palettes) and type definitions, however:

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

 return [
     'ctrl' => [
         'transOrigPointerField' => 'l10n_parent',
         'transOrigDiffSourceField' => 'l10n_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',
-            ],
-        ],
-        'l10n_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' => [
-                    [
-                        'label' => '',
-                        'value' => 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',
-            ],
-        ],
-        'l10n_diffsource' => [
-            'config' => [
-                'type' => 'passthrough',
-                'default' => '',
-            ],
-        ],
-        // ...
-    ],
     'palettes' => [
         'language' => [
             'showitem' => '
                sys_language_uid,l10n_parent,
            ',
        ],
     ],
     'types' => [
         0 => [
             'showitem' => '
                 --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
                     [...],
                 --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
                     --palette--;;language,
             ',
         ],
     ],
 ];
Copied!

Example: A table with localization support

A typical sys_language_uid field
EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php
<?php

return [
    'ctrl' => [
        'transOrigPointerField' => 'l10n_parent',
        'transOrigDiffSourceField' => 'l10n_diffsource',
        'languageField' => 'sys_language_uid',
        'translationSource' => 'l10n_source',
        // ...
    ],
    'palettes' => [
        'language' => [
            'showitem' => '
                sys_language_uid,l10n_parent,
            ',
        ],
    ],
    'types' => [
        0 => [
            'showitem' => '
                --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
                    [...],
                --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
                    --palette--;;language,
            ',
        ],
    ],
];
Copied!