Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
languageField
languageField
-
- Type
- string (field name of type language)
- Path
- $GLOBALS['TCA'][$table]['ctrl']
- Scope
- Proc. / Display
Deprecated since version 11.2
This field can only be used with the type language. All other field types will be automatically migrated on-the-fly possibly losing configurations. See Migration to the language type
This property contains the field name of the field which contains a pointer to the language of the record. The field should have the type language. The field is called sys_language_uid by convention.
This TCA type automatically displays all available languages for the current context (the corresponding site configuration) and also automatically adds the special
-1
language (meaningall languages
) for all record types, exceptpages
.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.
Example
<?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' => [
[
'',
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' => '',
],
],
// ...
],
];