Review main Merged

82065[BUGFIX] Use locale dependencies in Extbase LocalizationUtility

Benni Mack CR +2 V +2 Normal +89 −8 updated 12/04/23, 08:42

Commit message

Since TYPO3 v12.4, TYPO3 uses locales such as "de_DE"
or "de-AT" in Site Configuration natively.

In order to resolve the "locale dependencies" natively,
a new Locale object needs to be created be the "Locales"
factory class. This is needed to check for "de_AT.locallang.xlf"
and falling back to "de.locallang.xlf" in a multi-step mode.

This change adapts one place in Extbase's LocalizationUtility
where a new Locale object was previously instantiated via
new Locale() instead of using the "Locales" class which
deals with all dependencies (incl. manually defined dependencies)
directly there.

A new comment is added to explain this inside the constructor
of Locale.

In addition, some more tests are added (including the ones
that did not work before), as well as an example that
it does not matter if the file is called "de-AT.locallang.xlf"
(with a hyphen) or "de_CH.locallang.xlf" (with an underscore)

Review

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

Issues 2

Files 4

Review log 1012

  1. Benni Mack uploaded patch set 1 12/01/23, 22:15

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

  3. Garvin Hicking commented on patch set 1 CR +1 12/01/23, 22:32

    looking great, from pure reading this should work out, thanks. If not merged by monday, I'll test.
  4. Oliver Klee commented on patch set 1 12/02/23, 08:56

    Locale.php:67

    Is this a warning to not use the constructor directly? If so, I'd suggest the wording "Instead of creating instances directly, it is recommended …" to make this more explicit to the reader/developer.
  5. Benni Mack commented on patch set 2 CR +1 V +1 12/03/23, 19:35

    Published edit on patch set 1.
  6. Benni Mack commented on patch set 2 12/03/23, 19:35

    Locale.php:67 Reply

    Please check my updated comment
  7. core-ci voted on patch set 2 V +1 12/03/23, 19:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50291

  8. Oliver Klee commented on patch set 2 12/03/23, 20:19

    Locale.php:67 Reply

    Perfect! Thanks!
  9. Stefan Bürk voted on patch set 2 CR +1 V +1 12/03/23, 22:14

  10. Garvin Hicking commented on patch set 2 CR +1 V +1 12/04/23, 08:18

    Now tested, fixes my issue, thanks for providing the better way to solve it.
  11. Benni Mack voted on patch set 2 CR +2 V +2 12/04/23, 08:42

  12. Benni Mack merged patch set 3 12/04/23, 08:42