Review main Merged

77558[FEATURE] Add unified Locale class (IETF RFC 5646)

Benni Mack CR +2 V +2 Hard +359 −68 updated 01/24/23, 20:38

Commit message

A new locale class is added in order to migrate the
code base and the configuration towards real locales in
form of RFC 5646 language tag (en-AT) and optional
script code ("Hans") and optional country / region
based on ISO 3166-1.

This unifies handling of locales instead of dealing
with "default" or other TYPO3-specific namings in
user-land code and configuration.

This locale functionality at first serves
to handle "label files" (XLF), but will
be further extended to also work with the locale
to be used in the SiteLanguage object to simplify
configuration and Date/Time Formatting based
on php-intl.

Thus, the first and foremost topic is
to allow to create custom "LanguageService"
objects out of a defined Locale instead of
a string.

The locale class contains the actual
locale (such as "de-AT" or "en") but
also allows to use the backwards-compatibility
for the labels internally. It also contains the
dependencies, so they do not need to be evaluated
in various places and makes the public facing API
much easier to understand.

Next to the introduction of the Locale
object, this patch also adapts various places which touch
current LanguageService instantiations to use the Locale.

Next Steps:
* SiteLanguage.locale should use the object, as Locale uses a
   \Stringable interface.
* Reduce optional settings in Site Language object and editing interface
* A new languageService ($GLOBALS[LANG]) could and
   should be instantiated where it is needed, and not
   by re-using the same $GLOBALS[LANG] as this is needed
   This Reduce usages on $GLOBALS[LANG] by building
   a new LanguageService object based on the Context everywhere.
* Ideally deprecate $GLOBALS[LANG] in TYPO3 v12 LTS.

Review

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

Issues 1

Files 12

Review log 1219

  1. Benni Mack uploaded patch set 1 01/24/23, 09:14

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

  3. Oliver Klee updated the commit message in patch set 2 V +1 01/24/23, 09:25

  4. Benni Mack uploaded patch set 3 01/24/23, 09:31

  5. core-ci voted on patch set 2 V +1 01/24/23, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36518

  6. Benni Mack commented on patch set 4 01/24/23, 09:34

    Published edit on patch set 3.
  7. Benni Mack updated the commit message in patch set 5 01/24/23, 09:35

  8. Benni Mack uploaded patch set 6 01/24/23, 09:38

  9. core-ci voted on patch set 3 V +1 01/24/23, 09:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36519

  10. core-ci voted on patch set 5 V +1 01/24/23, 09:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36522

  11. core-ci voted on patch set 6 V +1 01/24/23, 09:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36523

  12. core-ci voted on patch set 4 V +1 01/24/23, 09:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36521

  13. Andreas Kienast commented on patch set 6 CR -1 01/24/23, 10:25

    on it
  14. Andreas Kienast uploaded patch set 7 CR -1 V +1 01/24/23, 10:39

  15. Andreas Kienast voted on patch set 7 V +1 CR +1 01/24/23, 10:39

  16. core-ci voted on patch set 7 V +1 01/24/23, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36529

  17. Christian Kuhn voted on patch set 7 CR +1 01/24/23, 13:07

  18. Georg Ringer voted on patch set 7 V +2 CR +2 01/24/23, 20:38

  19. Georg Ringer merged patch set 8 01/24/23, 20:38