Review main Abandoned

82061[BUGFIX] Return proper typo3Language key when using locale autodetection

Garvin Hicking CR 0 V 0 Easy +6 −0 updated 12/01/23, 22:48

Commit message

Language keys to resolve locallang.xlf file lookups with translations
refer to filenames like `de.locallang.xlf` or `dk.locallang.xlf`.

The language key "typo3Language" of a site configuration specifies
this key with strings like "de" or "dk".

With the introduction of #99882 the auto-detection appended the
country code of a language to that string, leading to the
"typo3Language" variable getting set to "de_DE" instead.

Locales like that are resolved to contain a lookup to both
the a "dependency" of a language ("de_DE" has a dependency on
"de").

For cases where the Locale instantiation was missing this
dependency, it will now be added on-the-fly.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 68

  1. Garvin Hicking uploaded patch set 1 12/01/23, 13:34

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

  3. Benni Mack commented on patch set 1 CR -1 12/01/23, 15:28

    I think I agree with your Note on your commit message: Let's solve that in that place. IMHO, the correct place to tackle this is LanguageService->readLLfile
  4. Garvin Hicking uploaded patch set 2 CR -1 V +1 12/01/23, 16:26

    Apply fix to Locale instantiation for proper failback chain
  5. Garvin Hicking commented on patch set 2 12/01/23, 16:29

    Reply

    Ack. This didn't feel right 😄 I've now tracked it down to EXT:login instantiating the Locale class with a missing dependency. So it instantiates Locale with $locale="de_DE" but $dependencies=[]. Other extensions like EXT:bootstrap_package and EXT:indexed_search actually instantiate Locale with $locale="de_DE" and $dependencies=['de']. It would be nice to know why this happens exactly. For now I've jury-rigged it to apply an addition to an empty $dependencies array to fill it with a substring of a locale, which shows languages properly then.
  6. core-ci voted on patch set 2 V +1 12/01/23, 16:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50214

  7. Benni Mack commented on patch set 2 12/01/23, 16:35

    sorry, next try: Please have a look at Locales->getLocaleDependencies()
  8. Garvin Hicking abandoned the change 12/01/23, 22:48

    Abandoned in favor of Bennis own #82065