Bug #86231

Distinguish between free-mode localization and chained translation

Added by Oliver Hader 7 days ago. Updated 7 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2018-09-12
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Based on my note https://forge.typo3.org/issues/86141#note-5 when analyzing the behavior

TL;DR

When skimming over the examples below, focus and compare the values in l10n_parent and realize that l10n_source is optional.

Usage

Localizations can be created using the graphical backend interface (e.g. page module) or by invoking direct commands to DataHandler [1]. Thus even if the page module is only valid for tt_content records, it does not prevent records from being translated or localized explicitly. That's why this analysis used element instead of tt_conent a pointer to a database table holding relevant records.

Terminology

Connected Mode

When translating elements, each element is bound to it's relative ancestor. This results into a chain (that can be used for language fallbacks etc.).
The following example illustrates that, l10n_parent always points to the initial record in default language, l10n_source points to it's relative translation ancestor - that's the record a new translation is based on. All records are connected in a chain.

+ element:1 - English (Default)           - language:0, l10n_parent=0, l10n_source=0
+ element:2 - French Translation          - language:1, l10n_parent=1, l10n_source=1
+ element:3 - Franco-Canadian Translation - language:2, l10n_parent=1, l10n_source=2

Free Mode

When localizing elements in free-mode, the previously mentioned translation chain is broken up, thus "free-mode localizaion elements" are in a specific language, but are not related to any relative ancestor and thus are idependent. The following example uses element:3 as "free-mode localization", l10n_parent is set to 0, but l10n_source still points to it's relative localization ancestor (just as information, not as a strict relation in like a "composition" [2] would have been).

+ element:1 - English (Default)           - language:0, l10n_parent=0, l10n_source=0
+ element:2 - French Translation          - language:1, l10n_parent=1, l10n_source=1
+ element:3 - Franco-Canadian Translation - language:2, l10n_parent=0, l10n_source=2

The Challenge

Translation from existing localization

It is possible, to create a new localization directly, that does not have a record in default language - or as alternative start a translation based on a "free-mode localization element".
The example shows, that the "English (Default)" record is now missing - the translation chain should(!) start with "French Translation" as first chain link. Since no record in default language s involved l10n_parent stay empty with 0, only l10n_source point to their according relative ancestor records.

+ element:2 - French Translation          - language:1, l10n_parent=0, l10n_source=1  # <- translation chain or free-mode localization?!
+ element:3 - Franco-Canadian Translation - language:2, l10n_parent=0, l10n_source=2  # <- translation chain or free-mode localization?!

When comparing the "Franco-Canadian Translation" here to the one shown in the "Free Mode" section, it cannot be distinguished anymore, whether the record is part of a "translation chain" or has been created as "free-mode localization".

The information in l10n_source is not mandatory

Besides that, the information stored in the l10n_source field is optional and has to be configured in the control section of $TCA using the translationSource property. Thus, that information might not be available at all. The following examples show persisted results without having the l10n_source information.

Connected Mode without l10n_source

+ element:1 - English (Default)           - language:0, l10n_parent=0
+ element:2 - French Translation          - language:1, l10n_parent=1  # <- part of a translation chain, which one?!
+ element:3 - Franco-Canadian Translation - language:2, l10n_parent=1  # <- part of a translation chain, which one?!

It is not possible anymore to determine at all, whether a record is part of a translation chain - since the relative ancestor is missing.

Free Mode without l10n_source

+ element:1 - English (Default)           - language:0, l10n_parent=0
+ element:2 - French Translation          - language:1, l10n_parent=1  # <- part of a translation chain, which one?!
+ element:3 - Franco-Canadian Translation - language:2, l10n_parent=0  # <- translation chain or free-mode localization?!

It is (like in section "Translation from existing localization") not possible to distinguish between "connected translations" and "free-mode localizations".

References

[1]: DataHandler commands "localize" and "copyToLanguage": https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Typo3CoreEngine/Database/Index.html#command-keywords-and-values
[2]: Association, Aggregation, Composition in UML: https://www.visual-paradigm.com/guide/uml-unified-modeling-language/uml-aggregation-vs-composition/


Related issues

Related to TYPO3 Core - Task #86141: Remove superfluous database contraint in DataMapProcessor Under Review 2018-09-04

History

#1 Updated by Oliver Hader 7 days ago

  • Related to Task #86141: Remove superfluous database contraint in DataMapProcessor added

#2 Updated by Oliver Hader 7 days ago

  • Description updated (diff)

#3 Updated by Oliver Hader 7 days ago

  • Description updated (diff)

#4 Updated by Oliver Hader 7 days ago

  • Description updated (diff)

Also available in: Atom PDF