Review main Merged

91552[TASK] Add basic XLIFF validation / linting

Garvin Hicking CR +2 V +2 Hard +359 −4 updated 11/14/25, 19:42

Commit message

This check is implemented for the CI pipeline.

It iterates all regular .xlf files in core extensions,
ensures:

-  XLIFF is parseable XML
-  a supported XLIFF version (1.2, 2.0) is set
   (1.0 is dropped, not used in core anymore)

Checks for XLIFF 1.2:
--------------------

-  matching namespaces (urn:oasis:names:tc:xliff:document:1.2)
-  attribute "file.source-language" is set to "en"
-  attribute "file.datatype" is set to "plaintext"
-  attribute "file.original" matches the own filename
-  "trans-unit" tags contain a non-empty ID
-  "trans-unit" does not contain deprecated keys
   (like mlang_labels_tablabel, mlang_labels_tabdescr,
   mlang_tabs_tab) without an "x-deprecated-since"
   attribute

Checks for XLIFF 2.0:
---------------------

-  non-empty "file.id" attribute

XLIFF 2.0 has less overhead, no more checks are implemented yet,
and might be covered in a follow-up. As of now, only very
few files use XLIFF 2.0. The concept could then be applied
here, too.

Local execution:
---------------

The script is executed in the CI checks, but can also
be called locally:

```
php Build/Scripts/checkIntegrityXliff.php
```

As a drive-by, the "originals" attributes of two xlf files
are fixed, and one file converted from XLIFF 1.0 to 1.2.
Also, the keys "description" and "short_description"
are now enforced to at least have empty contents,
because otherwise a fallback of the LanguageService
would show their label names instead of a content.

Note that checking xlf files of Site Sets is done seperately
via `Build/Scripts/checkIntegritySetLabels.php`.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Lina Wolf +1
    • Benni Mack +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Lina Wolf +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 3

Files 24

Show 4 more files

Review log 2024

  1. Garvin Hicking uploaded patch set 1 11/11/25, 13:30

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

  3. Garvin Hicking marked it work in progress 11/11/25, 13:55

  4. Garvin Hicking commented on patch set 1 CR -1 11/11/25, 14:21

  5. Garvin Hicking commented on patch set 2 CR -1 V -1 11/11/25, 14:21

    Published edit on patch set 1.
  6. Garvin Hicking commented on patch set 2 CR -1 11/11/25, 14:22

    Reply

    unresolve
  7. core-ci voted on patch set 2 V +1 11/11/25, 14:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89013

  8. Garvin Hicking uploaded patch set 3 CR -1 V +1 11/12/25, 16:50

  9. Garvin Hicking marked it ready for review 11/12/25, 16:50

  10. Garvin Hicking commented on patch set 3 11/12/25, 16:50

    Reply

    Done
  11. core-ci voted on patch set 3 V +1 11/12/25, 16:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89374

  12. Benni Mack voted on patch set 3 CR +1 V +1 11/12/25, 17:08

  13. Oliver Klee commented on patch set 3 11/12/25, 17:47

    Would it make sense to use the XLIFF validator that comes with the Symfony Translation component instead (or additionally)? https://github.com/TYPO3BestPractices/tea/blob/main/Build/xliff/xliff-lint
  14. Garvin Hicking commented on patch set 3 11/12/25, 18:14

    Reply

    I will resolve this, since the current solution implements what we need at this time and I cannot bring up energy to rework this. I appreciate the hint though. If someone wants to do that at a later time, I would not mind :-)
  15. Garvin Hicking uploaded patch set 4 CR +1 V +1 11/13/25, 09:16

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

  17. Benni Mack voted on patch set 4 CR +1 V +1 11/13/25, 21:26

  18. Lina Wolf commented on patch set 4 CR +1 V +1 11/14/25, 06:04

    Thanks! This has been needed!
  19. Garvin Hicking voted on patch set 4 CR +2 V +2 11/14/25, 06:05

  20. Garvin Hicking merged patch set 5 11/14/25, 06:05

  21. Christian Kuhn commented on patch set 5 11/14/25, 10:25

    this by default creates a rather longish list in CI now without value when green. i would prefer more silencing for the already rather complex 'integrity' job. example run: https://git.typo3.org/typo3/CI/cms/-/jobs/5004169

    integrity.yml:35

    this should run with php 8.2 as the others.
  22. Garvin Hicking commented on patch set 5 11/14/25, 10:39

    Reply

    Yes this was an error of mime. I will fix it in a followup, this was meant for verbose debug
  23. Lina Wolf commented on patch set 5 11/14/25, 11:22

    Reply

    Working on a follow up in exchange with Garvin who is afk: https://forge.typo3.org/issues/108125
  24. Christian Kuhn commented on patch set 5 11/14/25, 19:42

    Reply

    Done

    integrity.yml:35 Reply

    Done