Issue Bug Closed

#103130LocalizationUtility does not load translations correctly if TypoScript overrides exist

Markus Klein 02/15/24, 13:27 updated 01/23/26, 18:57

Description

Situation

We have an extension myext with 1 locallang.xlf containing labels for default and DE.

locallang.xlf for id “somekey”:
  • 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

History 713

  1. Markus Klein commented <span data-processor="relativetime" data-value="2024-02-15T13:31:07+00:00" > 02/15/24, 13:31 </span>

    It is yet to be determined if v12+ is affected as well. The code-base has changed a lot there.

  2. Gerrit Code Review pushed patch set 1 for 11.5 to change 83013 status Accepted Under Review <span data-processor="relativetime" data-value="2024-02-15T13:47:31+00:00" > 02/15/24, 13:47 </span>

  3. 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.

  4. Benni Mack commented and changed status Under Review Closed <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?

  5. Markus Klein commented and changed status Closed Needs 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.

  6. 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

  7. Markus Klein commented and changed status Needs Feedback Closed 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