#103130LocalizationUtility does not load translations correctly if TypoScript overrides exist
Description
Situation
We have an extension myext with 1 locallang.xlf containing labels for default and DE.
- default: some value
- de: ein Wert
In addition some TypoScript is in place to override some DE labels like so:
plugin.tx_myext._LOCAL_LANG.de.someotherkey = etwas anderes
Using the LocalizationUtility in this order yields the default label albeit the German version has been requested:
- `LocalizationUtility::translate(‘somekey’, ‘myext’)` => ‘some value’
- `LocalizationUtility::translate(‘somekey’, ‘myext’, ‘de’)` => ‘some value’
The German value is completely omitted.
Reason
The utility first loads the xlf data for the requested language key. (“default” in case of our first line)
After that all existing TS overrides are added to the internal static array. (“someotherkey” in our case)
Calling it the second time above, then skips load of the xlf-data for the requested languageKey “de”, due to the fact that data is already present because of the TS overrides processed in the first run.
Possible solution
Never store TS overrides in the internal array if the language is currently not requested.
Reviews 1
Related issues 1
History 713
-
Gerrit Code Review pushed patch set 1 for 11.5 to change 83013 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2024-02-15T13:47:31+00:00" > 02/15/24, 13:47 </span> -
Gerrit Code Review pushed patch set 2 for 11.5 to change 83013 <span data-processor="relativetime" data-value="2024-02-15T15:56:55+00:00" > 02/15/24, 15:56 </span>
-
Gerrit Code Review pushed patch set 3 for 11.5 to change 83013 <span data-processor="relativetime" data-value="2024-02-15T16:34:33+00:00" > 02/15/24, 16:34 </span>
-
Markus Klein changed Related to #103505 <span data-processor="relativetime" data-value="2024-03-30T19:01:24+00:00" > 03/30/24, 19:01 </span>
-
Gerrit Code Review pushed patch set 4 for 11.5 to change 83013 <span data-processor="relativetime" data-value="2024-03-30T21:13:26+00:00" > 03/30/24, 21:13 </span>
-
Gerrit Code Review pushed patch set 5 for 11.5 to change 83013 <span data-processor="relativetime" data-value="2024-03-30T21:32:02+00:00" > 03/30/24, 21:32 </span>
-
Markus Klein commented <span data-processor="relativetime" data-value="2024-03-30T21:32:47+00:00" > 03/30/24, 21:32 </span>
Markus Klein wrote in #note-1:
> It is yet to be determined if v12+ is affected as well. The code-base has changed a lot there.v12+ has its own problems. See related tickets.
The patch applies only for v11. -
Gerrit Code Review pushed patch set 6 for 11.5 to change 83013 <span data-processor="relativetime" data-value="2024-04-02T13:42:09+00:00" > 04/02/24, 13:42 </span>
-
Benni Mack commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2024-10-31T14:46:42+00:00" > 10/31/24, 14:46 </span>Closing this issue, as this is a v11 issue (where free support ends today). @markus can you check if this one https://forge.typo3.org/issues/103505 still exists in v12?
-
Markus Klein commented and changed status
ClosedNeeds Feedback <span data-processor="relativetime" data-value="2024-10-31T14:56:37+00:00" > 10/31/24, 14:56 </span>I didn’t check this on v12 yet. So this issue can still be a v12 thingy too.
Putting it into needs-feedback, so I don’t forget about it. -
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2025-08-17T14:19:32+00:00" > 08/17/25, 14:19 </span>
I can confirm that #103505 still exists for TYPO3 13.4.17 and EXT:news 12.3.0
-
Markus Klein commented and changed status
Needs FeedbackClosed removed the assignee <span data-processor="relativetime" data-value="2026-01-23T18:57:03+00:00" > 01/23/26, 18:57 </span>to be continued in #103505
It is yet to be determined if v12+ is affected as well. The code-base has changed a lot there.