Review main Merged

78325[BUGFIX] Ensure translate ViewHelper uses site language locale

Benni Mack CR +2 V +2 Easy +6 −8 updated 04/04/23, 13:39

Commit message

When using the `<f:translate>` ViewHelper out of Extbase
context (e.g., in `FLUIDTEMPLATE` or `StandaloneView`),
TYPO3 v12 checked for `$GLOBALS[LANG]`, which is wrong,
as this is the language of a backend editor - all
labels (outside of Extbase) were then rendered
with the editors view.

This is of course an ugly bug, which happened due to
https://review.typo3.org/c/Packages/TYPO3.CMS/+/75941

For this reason, `<f:translate>` does not check
for `$GLOBALS[LANG]` anymore, but instead checks for the
`SiteLanguage` first, and then checks for the
`$GLOBALS[BE_USER]`.

In addition, as long as we have a static list
of dependencies, the locale object needs to be
instantiated from the `Locales` class in order
to resolve the defined dependencies. This could
probably vanish once all information is put into
the right places.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 2