Issue Bug Closed

#103505Overriding locallang labels from TypoScript does not work as expected

Andreas Kießling 03/29/24, 23:21 updated 08/11/26, 08:46

Description

The changes from https://github.com/TYPO3/typo3/commit/26bccb635f297f9b0300899557d922bc677f81a5 with // Populate the initial values with default, if no labels for the current language are given are buggy

Example:
Back link in EXT:news with German labels installed outputs Zurück

<f:translate key="back-link" />

Now override the default label with

plugin.tx_news._LOCAL_LANG.default.back-link = Back to list

Expected result:
default: Back to list
German: Zurück

Actual result:
default: Back to list
German: Back to list

This should NOT change the german translation like in previous versions.

Reviews 5

History 1630

Show 5 earlier messages
  1. Andreas Kießling commented <span data-processor="relativetime" data-value="2024-03-30T20:57:41+00:00" > 03/30/24, 20:57 </span>

    I initially had a look at your patch, but the code was moved and refactored for v12.
    Your problem is, that first default is requested which builds up a cache and then DE is requested? In my case only DE labels are requested, but the overlay from TS is wrong.

    My problem seems to be in

    https://github.com/TYPO3/typo3/blob/b1bde78f4ac371cfc10bbc8ee868603f1fdc06d7/typo3/sysext/core/Classes/Localization/LanguageService.php#L274

    When i remove these lines it looks ok for my project.

    if (!isset($localLanguage[$mainLanguageKey])) {
      $localLanguage[$mainLanguageKey] = $localLanguage['default'];
    }
  2. Markus Klein commented <span data-processor="relativetime" data-value="2024-03-30T21:31:33+00:00" > 03/30/24, 21:31 </span>

    I noticed that all tests regarding TypoScript overriding had been removed. :-(

    I looked at the wrong file.

  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2025-08-17T14:19:56+00:00" > 08/17/25, 14:19 </span>

    I can confirm that this issue still exists for TYPO3 13.4.17 and EXT:news 12.3.0

  1. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2026-01-23T16:08:53+00:00" > 01/23/26, 16:08 </span>

    Hey, can you check if this still exists in latest v12 versions now?

  2. Andreas Kießling commented <span data-processor="relativetime" data-value="2026-01-23T16:30:24+00:00" > 01/23/26, 16:30 </span>

    I configured a very basic 12.4 setup.
    TYPO3 12.4.42 and EXT:news 13.0.1

    Without

    plugin.tx_news._LOCAL_LANG.default.back-link = Back to list

    When i configure the backPid in a news detail view, EN shows “Back”, DE shows “Zurück”

    With

    plugin.tx_news._LOCAL_LANG.default.back-link = Back to list

    both EN and DE show “Back to list”

  3. Andreas Kießling commented <span data-processor="relativetime" data-value="2026-01-23T16:41:35+00:00" > 01/23/26, 16:41 </span>

    The same behavior is also in TYPO3 13.4.24 with EXT:news 14.0.1

  4. Markus Klein commented <span data-processor="relativetime" data-value="2026-05-15T09:19:56+00:00" > 05/15/26, 09:19 </span>

    I can confirm the issue on 13.4.29 as well, with a custom extension.

    Manual workaround: Define language overrides for all languages. One needs to copy the default.
    Drawback: label updates from crowdin won’t be picked up.

    IMO: This is a Must-have fix for v13. (did not yet test on v14)

  5. Markus Klein changed assigned to Markus Klein priority Should have Must have <span data-processor="relativetime" data-value="2026-05-15T10:36:05+00:00" > 05/15/26, 10:36 </span>

  6. Gerrit Code Review pushed patch set 1 for 13.4 to change 94095 status Accepted Under Review <span data-processor="relativetime" data-value="2026-05-15T12:33:01+00:00" > 05/15/26, 12:33 </span>

  7. Markus Klein commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-06-10T09:55:09+00:00" > 06/10/26, 09:55 </span>

    Applied in changeset commit:76247ee3a23d47a53420933fc217a542c7b98453.