Feature: #78169 - Introduce "Translation Source" field for tt_content
See forge#78169
Description
The new database field l10n_ for tt_content table has been introduced together with a new TCA ctrl configuration translation.
The translation field contains a uid of the record used as a translation source, no matter whether the record was translated in the free or connected mode.
The new TCA configuration translation contains column name, similar to the trans.
e.g.
$GLOBALS['TCA']['tt_content']['ctrl']['translationSource'] = 'l10n_source';
Copied!
The new field solves few issues:
- There was no way to detect whether a record was translated using connected mode or free mode.
If a record has value > 0 in the
trans(e.g.Orig Pointer Field l10n_) field, it means it was translated using "connected mode". If theparent transis 0 but theOrig Pointer Field translationfield is > 0 it means it was translated using "free mode". If both are 0, it means the record was not translated but created manually.Source - TYPO3 allows to use a record in non-default language as a translation source. In this case the information about the translation source was lost.
Now, the
translationfield always contains a uid of the record used as a translation source.Source - In some places
orig(e.g.Uid t3_) fields were misused as a translation source. Now these places can be refactored to use theoriguid translationfield.Source
Difference between translationSource and other existing fields
trans(e.g.Orig Pointer Field l10n_) - "translation parent" - this field contains uid of the record in the default language representing the same content. Theparent translationfield can contain a uid of the record in non-default language.Source orig(e.g.Uid t3_) - "copy source" - this field contains uid of the record, current record was copied from. It might be equal tooriguid translationas localization is a copy internally, but often it is different.Source
See following test scenarios to see how data is handled in details.
\TYPO3\CMS\ Core\ Tests\ Functional\ Data Handling\ Regular\ Modify\ Action Test:: localize Content \TYPO3\CMS\ Core\ Tests\ Functional\ Data Handling\ Regular\ Modify\ Action Test:: localize Content From Non Default Language \TYPO3\CMS\ Core\ Tests\ Functional\ Data Handling\ Regular\ Modify\ Action Test:: copy Content To Language \TYPO3\CMS\ Core\ Tests\ Functional\ Data Handling\ Regular\ Modify\ Action Test:: copy Page \TYPO3\CMS\ Core\ Tests\ Functional\ Data Handling\ Regular\ Modify\ Action Test:: copy Page Free Mode \TYPO3\CMS\ Core\ Tests\ Functional\ Data Handling\ Regular\ Modify\ Action Test:: localize Page
Impact
Introduction of the new field is a base step for further refactorings, e.g.
- it opens a way to implement features like "reconnecting" free-mode translations back to the "connected mode"
- replace usage of the
t3_with theoriguid l10n_wheresource t3_is misused for language handling purposes (e.g. in LocalizationRepository)origuid