Review 14.3 Merged

94453[BUGFIX] Ensure correct TS overrides for labels

Christian Kuhn CR +2 V +2 Easy +40 −8 updated 06/10/26, 09:54

Commit message

The current implementation had several flaws, which are all fixed now.

1.) The assumption, that labels not having a translation
in the target language, will adhere to a TS override for the default
language is wrong. This would have to be applied for all
languages in the fallback chain, which is not possible
in the current code structure. We don't know which language
in the fallback chain contributed a value.

2.) LanguageService::getTypo3LanguageKey returns "en"
if a proper EN locale is present. This needs special
treatment in the overrides calculation, because there
"default" and "en" are actually the same.

3.) The LanguageService::overrideLabels array used a
completely wrong data structure, which made the array
override with the data structure from the XLF files
completely useless. Things only worked, because TS overrides where
inherited within the overrides from default, which covered a lot of
cases by accident.
This is also the reason, why the fixed bug actually occurred.

This change now fixes those flaws, aligns the test assumptions and adds
phpstan info too, for better understanding.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 34

  1. Christian Kuhn commented on patch set 1 06/10/26, 09:37

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 06/10/26, 09:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103295

  3. Christian Kuhn voted on patch set 1 CR +2 V +2 06/10/26, 09:54

  4. Christian Kuhn merged patch set 2 06/10/26, 09:54