Review main Merged

91368[TASK] Normalize formatting of all XLF files

Benni Mack CR +2 V +2 Impossible +24094 −24011 updated 12/09/25, 09:19

Commit message

CrowdIn XLF files use 2-space indentation. PHP's DOMDocument also emits
2-space indentation, while TYPO3 historically defined tabs in
.editorconfig but formatting in XLF files was inconsistent.

XLF formatting is now standardized to:

- 2-space indentation
- unified XML declaration (UTF-8)
- normalized attribute ordering
- consistent and canonical whitespace handling

This patch reformats all existing XLF files and introduces a script to
check or normalize XLF formatting. The check is integrated into CI and
can also be executed locally via:

  ./Build/Scripts/runTests.sh -s normalizeXliff -n

Formatting can be normalized automatically with:

  ./Build/Scripts/runTests.sh -s normalizeXliff

This ensures that all XLF files remain consistently formatted going
forward.

Review

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

Issues 1

Files 398

Show 378 more files

Review log 4456

Show 2431 earlier messages
  1. Benni Mack uploaded patch set 1 10/30/25, 14:44

  2. core-ci voted on patch set 1 V +1 10/30/25, 14:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88156

  3. Benni Mack uploaded patch set 2 V +1 10/30/25, 16:03

  4. core-ci voted on patch set 2 V +1 10/30/25, 16:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88165

  5. Lina Wolf commented on patch set 2 CR -1 10/31/25, 08:49

    Working on it
  6. Lina Wolf uploaded patch set 3 CR -1 V +1 10/31/25, 08:51

  7. Lina Wolf commented on patch set 3 10/31/25, 08:55

    Finished rebasing
  8. core-ci voted on patch set 3 V +1 10/31/25, 08:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88232

  9. Benni Mack uploaded patch set 4 V +1 11/03/25, 16:00

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

  11. Benni Mack commented on patch set 4 CR -1 11/03/25, 16:35

    Patch does not detect indentation with 4 spaces, reducing it to 2 spaces...
  12. Lina Wolf commented on patch set 4 11/05/25, 11:57

    We could just read in the file, pretty print it and compare the result. Then we could also use that script to replace all files with their pretty printed version?
  13. Benni Mack marked it work in progress 11/12/25, 22:38

  14. Lina Wolf uploaded patch set 5 CR -1 V +1 12/04/25, 17:20

  15. core-ci voted on patch set 5 V -1 12/04/25, 17:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91597

  16. Lina Wolf uploaded patch set 6 V -1 12/04/25, 17:54

  17. core-ci voted on patch set 6 V +1 12/04/25, 18:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91599

  18. Lina Wolf commented on patch set 6 CR +1 V +1 12/05/25, 06:17

    @benni@typo3.org I think this is ready for review
  19. Benni Mack marked it ready for review 12/05/25, 08:44

  20. Simon Schaufelberger voted on patch set 6 CR +1 V +1 12/05/25, 11:02

  21. Garvin Hicking commented on patch set 6 12/05/25, 11:12

    xliffIndentationChecker.sh:5

    Is this compatible for the GPL licensing? A thought: This also does some parsing like `Build/Scripts/checkIntegrityXliff.php` and iterates every XLIFF to check validity. Having this bash script that dynamically spawns PHP to do similar things feels a bit redundant. The PHP script however deals with some things in xliff2 unavailable to v13 though, but could probably be backported to v13...and then enhanced to do the missing "fix" operation on its own? (I could offer to improve the PHP script if we want to consider this)

    locallang_core.xlf:737

    This could have an effect when this is used within javascript messages that might have "real" quotes?
  22. Garvin Hicking commented on patch set 6 12/05/25, 11:23

    This will really be hard to backport to v13 completely... is this really helpful?

    locallang_layout.xlf:343

    (see note about possible ajax/js usage)

    messages.xlf:4

    this file lost all line endings?

    site.xlf:10

    I feel this might actually be an unneeded character?
  23. Lina Wolf commented on patch set 6 12/05/25, 11:40

    Reply

    I would suggest to just backport the script, ignoring all XLF files and then run the script again?

    site.xlf:10 Reply

    This would then be an error in the supplied label, not in the conversion script. I will make a separate PR to fix this
  24. Lina Wolf commented on patch set 6 12/05/25, 11:50

  25. Lina Wolf commented on patch set 6 12/05/25, 11:50

    site.xlf:10 Reply

    Done
  26. Lina Wolf commented on patch set 6 12/05/25, 11:59

    locallang_core.xlf:737 Reply

    In XML element text content (as opposed to attributes), " and " are exactly the same character once parsed.
  27. Lina Wolf commented on patch set 6 12/05/25, 12:07

    locallang_layout.xlf:343 Reply

    See my answer ;)

    messages.xlf:4 Reply

    Some earlier run must have corrupted the file, I restored it and run the script again. On doing so I found a stray "1" outside of the units. It would probably be a good idea we lint all XLIFF files against the scheme as well
  28. Lina Wolf uploaded patch set 7 CR +1 V +1 12/05/25, 12:07

  29. Lina Wolf commented on patch set 7 12/05/25, 12:11

    messages.xlf:4 Reply

  30. core-ci voted on patch set 7 V +1 12/05/25, 12:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91647

  31. Lina Wolf uploaded patch set 8 V +1 12/05/25, 14:28

  1. Lina Wolf commented on patch set 7 12/05/25, 14:30

    xliffIndentationChecker.sh:5 Reply

    I spoke to Benni and we can remove the copy right notice. I would not suggest to mix cgl / formatting tasks with linting / attribute checks as those are different concerns.
  2. core-ci voted on patch set 8 V +1 12/05/25, 14:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91658

  3. Garvin Hicking commented on patch set 8 CR +1 12/05/25, 16:16

    Reply

    Acknowledged
    Looking good to me now - if we can address the merge conflict I'm for it 😊

    xliffIndentationChecker.sh:5 Reply

    Acknowledged

    locallang_core.xlf:737 Reply

    Thanks. You're right, I had remembered this wrong.
  4. Lina Wolf uploaded patch set 9 CR +1 V +1 12/06/25, 05:29

  5. Lina Wolf commented on patch set 9 V -1 12/06/25, 05:32

    Working on it
  6. core-ci voted on patch set 9 V +1 12/06/25, 05:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91719

  7. Lina Wolf uploaded patch set 10 V +1 12/06/25, 08:17

  8. Lina Wolf commented on patch set 10 12/06/25, 08:21

    Upon trying to rebase I noted that the bash script was not really applying any changes anymore. I tried to fix the bug but it was hard to debug. So I decided to switch to PHP to align more with other scripts like checkIntegrityXliff.php. Then I tested again. I also aligned the runTests commands to work along the lines of the cgl command with -n used to only check but not apply fixes.
  9. core-ci voted on patch set 10 V +1 12/06/25, 08:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91721

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

  11. Simon Schaufelberger voted on patch set 10 CR +1 12/07/25, 09:34

  12. Lina Wolf voted on patch set 10 CR +1 V +1 12/07/25, 09:40

  13. Oliver Klee commented on patch set 10 12/07/25, 12:17

    .editorconfig:55

    ```suggestion indent_size = 2 ```
  14. Lina Wolf commented on patch set 11 CR +1 V +1 12/07/25, 12:51

    Published edit on patch set 10.
  15. Lina Wolf commented on patch set 11 12/07/25, 12:51

    .editorconfig:55 Reply

    Fix applied.
  16. Garvin Hicking voted on patch set 11 CR +1 V +1 12/07/25, 12:57

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

  18. Lina Wolf voted on patch set 11 CR +1 V +1 12/07/25, 13:49

  19. Sven Liebert voted on patch set 11 CR +1 V +1 12/07/25, 15:24

  20. Lina Wolf uploaded patch set 12 CR +1 V +1 12/09/25, 09:06

  21. Garvin Hicking voted on patch set 12 CR +1 V +1 12/09/25, 09:13

  22. Lina Wolf voted on patch set 12 CR +1 V +1 12/09/25, 09:14

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

  24. Benni Mack voted on patch set 12 CR +2 V +2 12/09/25, 09:19

  25. Benni Mack merged patch set 13 12/09/25, 09:19