#97763Translation Button shown eventhough already translated
Description
If content of a page is translated, but not the default language is chosen for the translation source, the localization button is still shown.
How to reproduce:
1. Create 2 additional languages
2. Have a page and add a content element in the default language
3. Translate it to the first language
4. Now, translate the third language, but choose the second language as translation source.
5. The translation button is still shown.
6. If you click on that button again it will skip the steps of the translation wizard and stay stuck in the last step showing just the spinner
Code hint:
It seems the new Page Module only considers the default language to unset the already translated records:
TYPO3\CMS\Backend\View\BackendLayout\ContentFetcher:179
if ((int)$contentElement['l10n_source'] > 0) {
unset($untranslatedRecordUids[(int)$contentElement['l10n_source']]);
}
The old PageLayoutView(L:1418) handled it differently:
foreach ($records as $record) {
$key = array_search($record['l10n_source'], $defaultLanguageUids);
if ($key !== false) {
unset($defaultLanguageUids[$key]);
}
}Reviews 1
Related issues 3
Files 1
History 1526
Show 01 earlier messages
-
Gerrit Code Review pushed patch set 1 for main to change 74919 status
NewUnder Review <span data-processor="relativetime" data-value="2022-06-15T15:26:03+00:00" > 06/15/22, 15:26 </span>
-
Nikita Hovratov changed Duplicated by #94397 <span data-processor="relativetime" data-value="2022-06-25T10:55:25+00:00" > 06/25/22, 10:55 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 74919 <span data-processor="relativetime" data-value="2022-06-25T20:30:02+00:00" > 06/25/22, 20:30 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 74919 <span data-processor="relativetime" data-value="2022-06-25T20:59:16+00:00" > 06/25/22, 20:59 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 74919 <span data-processor="relativetime" data-value="2022-06-25T21:56:34+00:00" > 06/25/22, 21:56 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 74919 <span data-processor="relativetime" data-value="2022-06-26T18:26:36+00:00" > 06/26/22, 18:26 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 74919 <span data-processor="relativetime" data-value="2022-07-05T09:05:10+00:00" > 07/05/22, 09:05 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 74919 <span data-processor="relativetime" data-value="2022-07-27T15:01:05+00:00" > 07/27/22, 15:01 </span>
-
Gerrit Hübbers changed Related to #98172 <span data-processor="relativetime" data-value="2022-08-18T17:30:54+00:00" > 08/18/22, 17:30 </span>
-
Gerrit Hübbers commented <span data-processor="relativetime" data-value="2022-08-19T12:59:31+00:00" > 08/19/22, 12:59 </span>
-
Gerrit Hübbers changed Duplicated by #98172 <span data-processor="relativetime" data-value="2022-08-22T08:00:33+00:00" > 08/22/22, 08:00 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 74919 <span data-processor="relativetime" data-value="2022-09-27T14:49:38+00:00" > 09/27/22, 14:49 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 74919 <span data-processor="relativetime" data-value="2022-09-27T14:59:47+00:00" > 09/27/22, 14:59 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 74919 <span data-processor="relativetime" data-value="2022-09-28T09:00:09+00:00" > 09/28/22, 09:00 </span>
-
Christoph Schwob commented <span data-processor="relativetime" data-value="2022-12-02T10:00:20+00:00" > 12/02/22, 10:00 </span>
Just want to add an idea to discuss:
afaik the backend user has no chance to see, from which language the elements has been translated. in den translate dialog this page will be skipped on every other translation round. And the left column is always the default language. Could we display this also?
-
Gerrit Code Review pushed patch set 11 for main to change 74919 <span data-processor="relativetime" data-value="2023-05-03T09:53:48+00:00" > 05/03/23, 09:53 </span>
-
Eric Harrer commented <span data-processor="relativetime" data-value="2023-08-03T22:09:31+00:00" > 08/03/23, 22:09 </span>
I can confirm this behavior for version 11 and 12. It doesn’t matter if you translate into free or connected mode.
TYPO3 v11, connected mode:
https://www.youtube.com/watch?v=NupBfRon5cQTYPO3v11, free mode.
https://www.youtube.com/watch?v=Q7IeuGnv0OETYPO3 v12, connected mode:
https://www.youtube.com/watch?v=i7tWwocBFG8TYPO3v12, free mode.
https://www.youtube.com/watch?v=w4anIZeSOP4 -
Eric Harrer changed Related to #101557 <span data-processor="relativetime" data-value="2023-08-03T22:09:58+00:00" > 08/03/23, 22:09 </span>
-
Eric Harrer changed
Related to #101557<span data-processor="relativetime" data-value="2023-08-03T22:11:17+00:00" > 08/03/23, 22:11 </span> -
Eric Harrer changed Related to #101564 <span data-processor="relativetime" data-value="2023-08-03T22:11:23+00:00" > 08/03/23, 22:11 </span>
-
Jo Hasenau commented and changed assigned to Jo Hasenau priority
Should haveMust have <span data-processor="relativetime" data-value="2024-02-17T11:36:54+00:00" > 02/17/24, 11:36 </span>We recently picked up this issues again after discussing it in the Translation Handling Initiative. The problem seems to be easy, but actually it shows essential flaws we’ve got in the core regarding the different translation related fields and their actual purpose and the knowledge about those purposes in the developer community.
I will use a comment of the patches already provided – in this case related to Classes/View/BackendLayout/ContentFetcher – to describe the problem a bit more detailed:
// Remove a possible translation from the untranslated record uids list. // If l10n_source is set, remove this value. // Else fall back to l18n_parent, but only if the translation source is the default language.Actually it is the other way around, since l18n_parent has to get the top priority. If there is a record in a language pointing to a translation parent in the default language, this default language record definitely has to be considered as translated to that language and definitely has to be in connected mode.
The value of l10n_source field simply depends on two different options:- Either you just translated the default language to the target language, then it points to the same parent element as the l18n_parent field would, but regardless of the translation mode. So in connected and free mode the value would be available and obviously point to the correct parent.
- Or within the translation wizard you fetched the translation content from another language, which had already been translated. In this case there is no way to determine if a record of the default language has been translated by just looking at l10n_source. So the free mode is not easy to fix.
With core versions before 13 there is the field t3_origuid though, which usually holds the parent of a copy action, which always precedes the data map process of fetching and filling in the actual content during a translation process. While this field could provide sufficient information, it often does not, especially when there were workspace actions involved. This is why the field has been removed during the development of version 13.
So the fix for connected mode is straight forward: Make sure the translation parent field gets the top priority over the translation source field throughout the core.
For the free mode we’ve got three options:- Either we provide a new field that gets the parent of a translation even in free mode but does not determine an actual connection.
- Or we will have to resolve possible connections between a default language record and a translation in a specific language recursively.
- Or we will have to provide a kind of translation index similar to the reference index that holds information about default language records and available translations. In this case we could even skip the translation parent field and make the table hold the whole set of information including connected or free mode.
IMHO we should go for options 1 or 2 for the time being but aim for option 3 in the long run.
Still we can come up with a quick fix for the connected mode, since this can be done independently from the free mode solution.
-
Jo Hasenau changed description <span data-processor="relativetime" data-value="2024-02-17T12:14:49+00:00" > 02/17/24, 12:14 </span>
-
Jo Hasenau commented <span data-processor="relativetime" data-value="2024-02-17T13:00:19+00:00" > 02/17/24, 13:00 </span>
For the connected mode adding a single line to content fetcher should be enough:
if ((int)$contentElement[‘l18n_parent’] > 0) {if ((int)$contentElement['l18n_parent'] > 0) { $languageTranslationInfo['hasTranslations'] = true; $languageTranslationInfo['mode'] = 'connected'; } if ((int)$contentElement['l10n_source'] > 0) { unset($untranslatedRecordUids[(int)$contentElement['l10n_source']]); }
$languageTranslationInfo[‘hasTranslations’] = true;
$languageTranslationInfo[‘mode’] = ‘connected’;
unset($untranslatedRecordUids[(int)$contentElement[‘l18n_parent’]]);
}
if ((int)$contentElement[‘l10n_source’] > 0) {
unset($untranslatedRecordUids[(int)$contentElement[‘l10n_source’]]);
} -
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2024-04-27T20:03:56+00:00" > 04/27/24, 20:03 </span>
Still reproducible on 13.2.0-dev (latest main)
-
Nikita Hovratov changed Related to #105343 <span data-processor="relativetime" data-value="2024-10-25T19:09:00+00:00" > 10/25/24, 19:09 </span>
-
Benni Mack commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-11-09T08:57:57+00:00" > 11/09/26, 08:57 </span>This is fixed with #106665 in v14, let me know if you still experience this in v14/v15.
With “patch set 7”, the issue from “patch set 1” found by Oliver ( https://review.typo3.org/c/Packages/TYPO3.CMS/+/74919/comments/034c07a0_8351a07c ) still exists:
> I did some testing and found that the button still reappears as soon as a new record is added to the default language, which is not yet translated to the language source of the second translation.
> Additionally, I found that the same problem (button is shown while no record is available for translation) also exists for the case that we have another language, which copied the records from the first localization (so is in free mode).