Review main Merged

91608[TASK] Raise deprecation error on using deprecated labels

Lina Wolf CR +2 V +2 Hard +424 −8 updated 12/05/25, 15:36

Commit message

Trigger an E_USER_DEPRECATED error when deprecated localization labels
are first written to the cache. This makes usage of deprecated labels
visible at runtime.

Labels ending with `.deprecated` are also treated as deprecated,
regardless of the loader. When referenced with or without the suffix, a
deprecation warning is raised. Such cases are possible but generally
unlikely.

Warnings are issued for usages via `LanguageService` (`sL()`) and the
`f:translate` ViewHelper. The Extension Scanner cannot detect these
occurrences.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Sven Liebert +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Riccardo De Contardi +1
    • Sven Liebert +1
    • core-ci +1 CI

Issues 1

Files 12

Review log 3143

Show 1118 earlier messages
  1. Lina Wolf uploaded patch set 1 11/13/25, 10:14

  2. Lina Wolf updated the commit message in patch set 2 11/13/25, 10:16

  3. core-ci voted on patch set 1 V -1 11/13/25, 10:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89456

  4. Lina Wolf uploaded patch set 3 11/13/25, 10:29

  5. core-ci voted on patch set 2 V -1 11/13/25, 10:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89457

  6. Lina Wolf rebased onto patch set 4 11/13/25, 10:35

  7. Lina Wolf uploaded patch set 5 11/13/25, 10:39

  8. core-ci voted on patch set 3 V -1 11/13/25, 10:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89461

  9. core-ci voted on patch set 4 V -1 11/13/25, 10:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89463

  10. core-ci voted on patch set 5 V -1 11/13/25, 10:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89468

  11. Lina Wolf uploaded patch set 6 V -1 11/13/25, 11:05

  12. core-ci voted on patch set 6 V +1 11/13/25, 11:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89470

  13. Garvin Hicking commented on patch set 6 11/13/25, 11:24

    Thanks, that's a well-written deprecation ReST! 😊

    Deprecation-108086-RaiseDeprecationErrorOnUsingDeprecatedLabels.rst:77

    what about when using this with `->translate()` and `->translateLabel()`?

    Deprecation-108086-RaiseDeprecationErrorOnUsingDeprecatedLabels.rst:88

    Also give an example for the "domain" syntax, just to use this to teach the "new way"?

    TranslateViewHelperTest.php:234

    please use `'template' => '...', 'expected' => '...'` keys for the array so we are upward compatible with new PHPUnit requirements in the future (or use a generator here as well)

    TranslateViewHelperTest.php:465

    (see above)
  14. Lina Wolf commented on patch set 6 11/13/25, 11:30

    Deprecation-108086-RaiseDeprecationErrorOnUsingDeprecatedLabels.rst:77 Reply

    translate() is still internal, translateLabel() calls sL as do various other methods, for example extbase Localization Factory. Should we mention them all?
  15. Garvin Hicking commented on patch set 6 11/13/25, 11:47

    Deprecation-108086-RaiseDeprecationErrorOnUsingDeprecatedLabels.rst:77 Reply

    Of course, you're right. Let's keep leaving this out then!
  16. Oliver Klee updated the commit message in patch set 7 V +1 11/13/25, 11:55

  17. core-ci voted on patch set 7 V +1 11/13/25, 12:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89483

  18. Lina Wolf uploaded patch set 8 V +1 11/13/25, 13:25

  1. Lina Wolf commented on patch set 8 11/13/25, 13:27

    Deprecation-108086-RaiseDeprecationErrorOnUsingDeprecatedLabels.rst:88 Reply

    Done

    TranslateViewHelperTest.php:234 Reply

    Done

    TranslateViewHelperTest.php:465 Reply

    Done
  2. core-ci voted on patch set 8 V +1 11/13/25, 13:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89503

  3. Lina Wolf uploaded patch set 9 V +1 11/15/25, 09:46

  4. core-ci voted on patch set 9 V +1 11/15/25, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89777

  5. Lina Wolf rebased onto patch set 10 V +1 11/25/25, 11:41

  6. core-ci voted on patch set 10 V +1 11/25/25, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90941

  7. Garvin Hicking voted on patch set 10 CR +1 V +1 11/25/25, 12:12

  8. Lina Wolf uploaded patch set 11 CR +1 V +1 11/26/25, 11:02

  9. Garvin Hicking voted on patch set 11 CR +1 V +1 11/26/25, 11:05

  10. Sven Liebert voted on patch set 11 CR +1 V +1 11/26/25, 11:10

  11. core-ci voted on patch set 11 V +1 11/26/25, 11:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91014

  12. Riccardo De Contardi voted on patch set 11 V +1 11/26/25, 14:26

  13. Benni Mack commented on patch set 11 11/26/25, 14:50

    do we really like ".deprecated"? I mean... we could do something like "._deprecated" to be really sure, it's not used currently in any project? I don't know. If we agree, we're good with ".deprecated" let's do this.
  14. Garvin Hicking commented on patch set 11 11/26/25, 14:57

    Reply

    Fair point, extensions might want to use identifiers called "some_old_api.deprecated" and still emit that label, because not the label itself is deprecated but describes something deprecated. `._deprecated` isn't easy on the eye. How about `.x-unused`? That would be in line with our 'x-unused-since` extension? (If the dash isn't a problem)
  15. Lina Wolf uploaded patch set 12 CR +1 V +1 11/27/25, 18:53

  16. Lina Wolf commented on patch set 12 11/27/25, 18:54

    Reply

    Done
  17. core-ci voted on patch set 12 V +1 11/27/25, 19:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91127

  18. Riccardo De Contardi commented on patch set 12 V +1 12/01/25, 11:13

    verified with a couple of used labels and - old xlf syntax (x-unused-since) - new xlf syntax (subState="deprecated")
  19. Oliver Klee voted on patch set 12 V +1 12/01/25, 11:21

  20. Benni Mack commented on patch set 12 12/02/25, 17:59

    LanguageService.php:226

    when would this happen? When the somebody explicitly calls "mylabel.x-unused"?
  21. Lina Wolf commented on patch set 12 12/02/25, 18:02

    LanguageService.php:226 Reply

    yes, as using labels ending on ".x-unused" is also deprecated
  22. Benni Mack commented on patch set 12 CR +1 12/03/25, 16:25

    LanguageService.php:226 Reply

    Done
  23. Sven Liebert voted on patch set 12 CR +1 V +1 12/04/25, 12:36

  24. Benni Mack voted on patch set 12 CR +2 V +2 12/05/25, 15:36

  25. Benni Mack merged patch set 13 12/05/25, 15:36