Review main Merged

92466[BUGFIX] Localize labels for locale with country-code

Ayke Halder CR +2 V +2 Hard +444 −101 updated 09/30/26, 07:50

Commit message

A locale configured with country-code like
'fr_LU.utf8' results in localization using the locale `fr`.
Before the undefined locale `fr-LU` was tried, resulting in no proper
fallback to 'fr', and then directly falling through to the 'default'
fallback.

This enables TypoScript `_LOCAL_LANG` overrides with and without
country-code to both work for e.g. the configured locale `fr-LU`:

* `_LOCAL_LANG.fr-LU.some_label = Test français Luxembourg`
* `_LOCAL_LANG.fr.some_other_label = Test français`

Important: The correct syntax for `_LOCAL_LANG` is e.g. `fr-LU`.
That is lowercase language-code, followed by a 'dash',
and finally closed by uppercase country-code.

The TypoScript `_LOCAL_LANG.default` override is degraded to a last
resort fallback. It is only applied, if a label is unresolvable as it
is completely missing from all other options:

* No entry in `locallang.xlf` or any localization dependency XLIFF file
* No TypoScript `_LOCAL_LANG.lang-key` label override with the lang-key
  in localization dependency

To override labels for English localization use:

* `_LOCAL_LANG.en-US.some_label = Test US english`
* `_LOCAL_LANG.en.some_other_label = Test english`

Note:
The `default` language setting in Site configuration is automatically
converted to `en` via `Locale::normalize()` - see [1].
This conversion became active with follow-up changes which started to
use `Locale::createLocale()` for Site configuration handling.

[1] I9e2464699a2e53f4e3b136e0b66351f9f3aaf71f

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Benni Mack +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 15

Review log 2444

Show 1119 earlier messages
  1. Ayke Halder uploaded patch set 1 01/22/26, 17:15

  2. core-ci voted on patch set 1 V +1 01/22/26, 17:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94071

  3. Ayke Halder uploaded patch set 2 V +1 01/22/26, 17:59

  4. Ayke Halder updated the commit message in patch set 3 01/22/26, 18:02

  5. core-ci voted on patch set 2 V -1 01/22/26, 18:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94075

  6. core-ci voted on patch set 3 V -1 01/22/26, 18:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94077

  7. Markus Klein commented on patch set 3 06/04/26, 21:26

  8. Ayke Halder commented on patch set 3 07/03/26, 13:49

    LanguageService.php:353

    @markus.klein@typo3.org About the other patch: 94328: [BUGFIX] Ensure correct TS overrides for labels | https://review.typo3.org/c/Packages/TYPO3.CMS/+/94328 Here: In case the non-existant human language `default` is queried: -> This enforces proper human language `en`.
  9. Ayke Halder uploaded patch set 4 V -1 07/03/26, 14:27

  10. core-ci voted on patch set 4 V -1 07/03/26, 14:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104301

  11. Ayke Halder uploaded patch set 5 V -1 07/03/26, 15:09

  12. core-ci voted on patch set 5 V -1 07/03/26, 15:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104307

  13. Ayke Halder uploaded patch set 6 V -1 07/03/26, 16:40

  14. core-ci voted on patch set 6 V -1 07/03/26, 16:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104312

  15. Ayke Halder uploaded patch set 7 V -1 07/05/26, 09:54

  16. core-ci voted on patch set 7 V -1 07/05/26, 10:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104358

  17. Ayke Halder uploaded patch set 8 V -1 07/05/26, 20:13

  18. core-ci voted on patch set 8 V +1 07/05/26, 20:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104364

  19. Ayke Halder uploaded patch set 9 V +1 07/05/26, 21:00

  1. core-ci voted on patch set 9 V +1 07/05/26, 21:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104365

  2. Ayke Halder uploaded patch set 10 V +1 07/06/26, 14:47

  3. core-ci voted on patch set 10 V -1 07/06/26, 14:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104410

  4. Ayke Halder uploaded patch set 11 V -1 07/06/26, 15:39

  5. core-ci voted on patch set 11 V +1 07/06/26, 15:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104413

  6. Ayke Halder uploaded patch set 12 V +1 07/06/26, 18:00

  7. core-ci voted on patch set 12 V +1 07/06/26, 18:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104419

  8. Ayke Halder uploaded patch set 13 V +1 07/08/26, 16:04

  9. core-ci voted on patch set 13 V +1 07/08/26, 16:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104534

  10. Ayke Halder uploaded patch set 14 V +1 07/08/26, 16:26

  11. core-ci voted on patch set 14 V +1 07/08/26, 16:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104535

  12. Oliver Klee updated the commit message in patch set 15 V +1 07/09/26, 07:21

  13. core-ci voted on patch set 15 V +1 07/09/26, 07:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104556

  14. Ayke Halder uploaded patch set 16 V +1 07/16/26, 14:05

  15. Ayke Halder uploaded patch set 17 07/16/26, 14:10

  16. core-ci voted on patch set 16 V -1 07/16/26, 14:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104831

  17. core-ci voted on patch set 17 V +1 07/16/26, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104832

  18. Ayke Halder uploaded patch set 18 V +1 07/16/26, 19:45

  19. core-ci voted on patch set 18 V +1 07/16/26, 19:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104840

  20. Benni Mack uploaded patch set 19 V +1 09/23/26, 15:59

  21. core-ci voted on patch set 19 V -1 09/23/26, 16:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109084

  22. core-ci voted on patch set 19 V +1 09/23/26, 17:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109084

  23. Benni Mack voted on patch set 19 CR +1 V +1 09/23/26, 18:00

  24. Garvin Hicking voted on patch set 19 CR +2 V +2 09/30/26, 07:50

  25. Garvin Hicking merged patch set 20 09/30/26, 07:50