Review main Merged

91129[FEATURE] TranslateViewHelper supports new Translation Domain syntax

Benni Mack CR +2 V +2 Hard +241 −22 updated 11/04/25, 20:23

Commit message

This change adds a new "domain" attribute to
the <f:translate> ViewHelper.

Further variants are now supported in Fluid:

  <f:translate key="LLL:core.common:delete" />
  <f:translate key="core.common:delete" />
  <f:translate key="delete" domain="core.common" />

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 1620

  1. Benni Mack uploaded patch set 1 10/17/25, 14:00

  2. core-ci voted on patch set 1 V -1 10/17/25, 14:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86911

  3. Garvin Hicking commented on patch set 1 10/17/25, 14:38

    LocalizationUtility.php:50

    I think we need to ensure that if a key="XXX" entry can NOT be resolved to some kind of domain, we still thrown an exception. To ensure that not suddenly "bad" fluid templates return empts strings where they threw up before. (`<f:translate key="nothingreally.idontknow">` should not suddenly "work", I suppose)
  4. Benni Mack commented on patch set 1 10/17/25, 14:51

    LocalizationUtility.php:50 Reply

    that's why I actually suggest to introduce the "domain" argument, so people start using it "properly".
  5. Benni Mack rebased onto patch set 2 V -1 10/17/25, 15:58

  6. core-ci voted on patch set 2 V -1 10/17/25, 16:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86937

  7. Garvin Hicking commented on patch set 2 10/17/25, 19:15

    LocalizationUtility.php:50 Reply

    Maybe then we should leave the "LLL" requirement stay UNLESS we have a "domain" argument? and then either rewire "key" to utilize shorthand notation, or use a "label" (or other) attrbute to reference the actual label?
  8. Lina Wolf commented on patch set 2 10/20/25, 10:41

    LocalizationUtility.php:50 Reply

    I think it would be great if these 3 could work: ``` <f:translate key="LLL:core.common:delete" /> <f:translate key="core.common:delete" /> <f:translate key="delete" domain="core.common" /> ```
  9. Benni Mack uploaded patch set 3 V -1 10/20/25, 14:08

  10. core-ci voted on patch set 3 V -1 10/20/25, 14:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87085

  11. Benni Mack uploaded patch set 4 V -1 10/20/25, 15:01

  12. core-ci voted on patch set 4 V +1 10/20/25, 15:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87092

  13. Benni Mack commented on patch set 4 10/20/25, 15:16

    LocalizationUtility.php:50 Reply

    Done
  14. Georg Ringer voted on patch set 4 CR +1 V +1 10/20/25, 18:33

  15. Stefan Bürk voted on patch set 4 CR +1 10/20/25, 18:59

  16. Stefan Bürk voted on patch set 4 V +1 10/20/25, 19:06

  17. Benni Mack voted on patch set 4 CR +2 V +2 10/20/25, 21:44

  18. Benni Mack merged patch set 5 10/20/25, 21:44

  19. Lina Wolf commented on patch set 5 10/26/25, 10:50

    TranslateViewHelper.php:103

    From reading the code I believe this means that when the ViewHelper has a default value set AND uses the domain translation syntax without LLL: prefix then the default value will be returned and not the value of the translation file. is this behavioiur intended?
  20. Lina Wolf commented on patch set 5 10/26/25, 11:00

    TranslateViewHelper.php:103 Reply

    Wrote a test to verify this, it seems like it is indeed a bug, opened an issue: https://forge.typo3.org/issues/107841