Language fields
See also the Frontend Localization Guide.
Note
It is possible to change the names of the following fields, however this is strongly discouraged as it breaks convention and may lead to compatibility issues with third party extensions.
All fields mentioned below get added to the database automatically. It is
not recommended to define them in the ext_
. Doing so
with incompatible SQL settings can lead to problems later on.
Language fields in detail
sys_
language_ uid -
This field gets defined in ctrl->languageField. If this field is defined a record in this table can be translated into another language.
l10n_
parent -
This field gets defined in ctrl->transOrigPointerField.
If this value is found being set together with languageField then FormEngine will show the default translation value under the fields in the main form.
Note
Sometimes
l18n_
is used for this field in Core tables. This is for historic reasons.parent
l10n_
source -
This field gets defined in ctrl->translationSource.
This field contains the uid of the record the translation was created from. For example if your default language is English and you already translated a record into German you can base the Suisse-German translation on the German record. In this case
l10n_
would contain the uid of the English record whileparent l10n_
contains the uid of the German record.source
l10n_
diffsource -
This field gets defined in ctrl->transOrigPointerField.
This information is used later on to compare the current values of the default record with those stored in this field. If they differ, there will be a display in the form of the difference visually:
Note
Sometimes
l18n_
is used for this field in Core tables. This has historic reasons.diffsource
Example: enable table for localization and translation:
<?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,
',
],
],
];