#101814Subsequent finisher options wrongly translated when options.translation.language was set in previous finisher
Description
*Example:*
A form with two E-Mail finishers is configured, the first of which has options.translation.language set to Standard, like this:
finishers:
-
options:
subject: 'New request'
recipients:
'some.receiver@company.com': Company
senderAddress: noreply@company.com
senderName: Company
addHtmlPart: true
attachUploads: false
useFluidEmail: true
translation:
language: Standard
identifier: EmailToReceiver
-
options:
subject: 'Your request'
recipients:
'{email}': '{firstName} {lastName}'
senderAddress: noreply@company.com
senderName: Company
addHtmlPart: true
attachUploads: false
useFluidEmail: true
identifier: EmailToSender
Furthermore the following german label is configured, which should override the subject of the second finisher when the form was submitted on a german page:
<trans-unit id="finisher.EmailToSender.subject">
<source>Your request</source>
<target>Ihre Anfrage</target>
</trans-unit>
When submitting the form on a german page however, the subject remains in the default language. If the first finisher is removed (or if options.translation.language is removed from its configuration) it is properly translated into german.
*The issue:*
In \TYPO3\CMS\Form\Domain\Finishers\EmailFinisher the service \TYPO3\CMS\Form\Service\TranslationService is used, which is a SingletonInterface (and this might also affect other finishers using the TranslationService). The EmailFinisher memorizes the initial language like this:
$translationService = GeneralUtility::makeInstance(TranslationService::class);
if (is_string($this->options['translation']['language'] ?? null) && $this->options['translation']['language'] !== '') {
$languageBackup = $translationService->getLanguage();
$translationService->setLanguage($this->options['translation']['language']);
}
and later restores it like this:
if (!empty($languageBackup)) {
$translationService->setLanguage($languageBackup);
}
However the memorization happens after many calls of $this->parseOption(), which internally eventually calls TranslationService::translate() passing along the language configured in options.translation.language. In TranslationService::translate() the services languageKey is updated to this language:
if ($language) {
$this->languageKey = $language;
}
Therefore, when memorizing the initial language of the TranslationService, it’s already set to another language, which also means that the restoration of the initial language does not work. And since TranslationService is a Singleton, the now incorrect language remains throughout following finishers.
*Possible solutions:*
1. move the initial language memorization in front of the parseOption()-calls
2. Don’t update $this->languageKey in TranslationService::translate(). Use $language for this specific call of translate() and fall back to $this->languageKey if $language is null. Calling translate() with a different language than the one currently set as default in the TranslationService does not imply to me, that the services default language will be changed in the process.
*Additional information:*
This might also be the case in TYPO3 12.
This applies across all valid php versions.
Reviews 2
Related issues 1
History 521
-
Josua Vogel changed Related to #103899 <span data-processor="relativetime" data-value="2025-10-14T14:15:49+00:00" > 10/14/25, 14:15 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 91100 status
NewUnder Review <span data-processor="relativetime" data-value="2025-10-16T11:12:28+00:00" > 10/16/25, 11:12 </span> -
Gerrit Code Review pushed patch set 2 for main to change 91100 <span data-processor="relativetime" data-value="2025-10-16T22:25:30+00:00" > 10/16/25, 22:25 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 91100 <span data-processor="relativetime" data-value="2025-10-16T22:41:38+00:00" > 10/16/25, 22:41 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 91100 <span data-processor="relativetime" data-value="2025-10-16T22:51:49+00:00" > 10/16/25, 22:51 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 91100 <span data-processor="relativetime" data-value="2025-10-17T14:56:55+00:00" > 10/17/25, 14:56 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 91100 <span data-processor="relativetime" data-value="2025-11-25T15:54:33+00:00" > 11/25/25, 15:54 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-16T09:31:09+00:00" > 01/16/26, 09:31 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-16T09:57:21+00:00" > 01/16/26, 09:57 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-16T10:30:23+00:00" > 01/16/26, 10:30 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-21T13:33:04+00:00" > 01/21/26, 13:33 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-21T13:54:39+00:00" > 01/21/26, 13:54 </span>
-
Gerrit Code Review pushed patch set 12 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-26T07:52:26+00:00" > 01/26/26, 07:52 </span>
-
Gerrit Code Review pushed patch set 13 for main to change 91100 <span data-processor="relativetime" data-value="2026-01-26T08:09:45+00:00" > 01/26/26, 08:09 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 92740 <span data-processor="relativetime" data-value="2026-02-07T16:55:35+00:00" > 02/07/26, 16:55 </span>
-
Gerrit Code Review pushed patch set 14 for main to change 91100 <span data-processor="relativetime" data-value="2026-02-12T19:14:22+00:00" > 02/12/26, 19:14 </span>
-
Gerrit Code Review pushed patch set 15 for main to change 91100 <span data-processor="relativetime" data-value="2026-02-13T09:34:28+00:00" > 02/13/26, 09:34 </span>
-
Josua Vogel commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-02-13T11:25:07+00:00" > 02/13/26, 11:25 </span>Applied in changeset commit:f99ea6a2803d542130d084a86c7a03c67a7c001e.
-
Garvin Hicking changed Duplicated by #109260 <span data-processor="relativetime" data-value="2026-03-17T06:45:10+00:00" > 03/17/26, 06:45 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T09:00:36+00:00" > 03/31/26, 09:00 </span>
We have the same problem. Our site has 2 languages: DE and EN. The form has multiple finishers and in one specific finisher we set the language to DE. In frontend in EN all subsequent finishers are then also DE. But when we change the part
to
it seems to work. Maybe I’m wrong, but when frontend is EN the
$translationService->getLanguage()returns an empty string, so the$languageBackupis always empty resulting in keeping the overridden language of the finisher.