Skip to content
Snippets Groups Projects
Commit 4518a1f4 authored by Benni Mack's avatar Benni Mack Committed by Kevin Appelt
Browse files

[BUGFIX] Ensure translate ViewHelper uses site language locale

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.

Resolves: #100255
Resolves: #100176
Releases: main
Change-Id: I50c24008f0a16432e9122e0e186cd4a9b8e8f476
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78325


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarMarc Willmann <mw@f7.de>
Reviewed-by: default avatarMarc Willmann <mw@f7.de>
Reviewed-by: default avatarKevin Appelt <kevin.appelt@icloud.com>
Tested-by: default avatarKevin Appelt <kevin.appelt@icloud.com>
parent 572e6df5
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment