Review main Ready for review

98268[FEATURE] Translate messages of Symfony constraints

Alexander Schnitzler CR 0 V 0 Hard +426 −7 updated 12/01/26, 19:04

Commit message

Messages of Symfony constraints on Extbase model properties were
always English. ConstraintDecoratingValidator now translates every
violation message that is not a label reference with the catalogs
shipped by symfony/validator, in the language of the current request
or, without a frontend request, of the backend user.

A regional locale without own catalog uses the catalog of its
language, a locale without catalog falls back to English. Label
references are translated with the TYPO3 labels as before, custom
messages stay untranslated.

The catalogs are loaded with a separate Symfony translator, not with
the localization of TYPO3, because the latter cannot read the file
names and keys used by Symfony. Loading them through the localization
of TYPO3 would make overrides, language packs and locale fallback
chains apply to them as well. No decision has been made about this
yet.

The test asserting that constraint messages stay English for a
German request is replaced, as it pinned the behaviour this feature
changes.
Show more Show less

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/68/98268/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/68/98268/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 1

Issues 1

Files 4

Review log 34

  1. Alexander Schnitzler uploaded patch set 1 12/01/26, 18:58

  2. Alexander Schnitzler wrote 12/01/26, 18:58

    Topic set to extbase
  3. Alexander Schnitzler marked it ready for review 12/01/26, 19:01

  4. core-ci voted on patch set 1 V +1 12/01/26, 19:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116134