XLIFF format normalisation: convert remaining 1.2 catalogues to 2.0 - #3770
Merged
Conversation
Six catalogues were still in XLIFF 1.2 while the rest of translations/ uses 2.0. Converted them with Symfony's own XliffFileLoader + XliffFileDumper (xliff_version: 2.0, default_locale: en), so the output matches what translation:extract produces. The hu and zh_CN files additionally declared source-language equal to their target language; the sources are English keys, so srcLang is now correctly "en". No translated content changes: key sets, ordering, unit ids, targets and notes are byte-identical before and after, verified by loading both revisions through XliffFileLoader and comparing. messages.pt_BR.xlf is deliberately left as 1.2 - it is an empty catalogue, and XLIFF 2.0 requires <file> to have at least one child, so an empty 2.0 file would not validate against the schema.
Eight catalogues declared the wrong target language and/or the wrong <file id>: messages.el, security.el, validators.el trgLang="en", id="*.en" messages.tr, security.tr, validators.tr trgLang="en", id="*.en" messages.uk, validators.uk id="*.en" These are metadata declarations only - Symfony's XLIFF loader reads the <target> elements regardless, so el, tr and uk render correctly today and this changes nothing at runtime. It makes the headers consistent with the other catalogues and with translation:extract output. Only the two header lines change in each file; no unit was touched.
The file contained an empty <body> with zero trans-units, so it provided no translations - pt_BR already fell back to English for every messages key. It was also the one catalogue that could not be converted to XLIFF 2.0, since the schema requires <file> to have at least one child element. Removing it leaves translations/ entirely on XLIFF 2.0 and changes no behaviour: debug:translation reports the same 258 missing messages keys for pt_BR before and after.
Contributor
There was a problem hiding this comment.
Pull request overview
Normalizes translation catalogues under translations/ by converting the last remaining XLIFF 1.2 files to XLIFF 2.0, correcting catalogue header metadata (language + <file id>), and removing an empty, non-convertible catalogue.
Changes:
- Convert remaining XLIFF 1.2 catalogues (
hu,zh_CN,pt_BRvariants) to XLIFF 2.0 and update headers (srcLang/trgLang,<file id>) accordingly. - Fix incorrect
trgLang/<file id>headers in existing XLIFF 2.0 catalogues forel,tr, anduk. - Remove the empty
messages.pt_BR.xlfcatalogue.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| translations/validators.zh_CN.xlf | Convert validators catalogue from XLIFF 1.2 → 2.0; correct header metadata. |
| translations/validators.uk.xlf | Fix <file id> header for Ukrainian validators catalogue. |
| translations/validators.tr.xlf | Fix trgLang and <file id> headers for Turkish validators catalogue. |
| translations/validators.pt_BR.xlf | Convert validators catalogue from XLIFF 1.2 → 2.0; preserve “obsolete” notes. |
| translations/validators.hu.xlf | Convert validators catalogue from XLIFF 1.2 → 2.0; correct header metadata. |
| translations/validators.el.xlf | Fix trgLang and <file id> headers for Greek validators catalogue. |
| translations/security.zh_CN.xlf | Convert security catalogue from XLIFF 1.2 → 2.0; correct header metadata. |
| translations/security.tr.xlf | Fix trgLang and <file id> headers for Turkish security catalogue. |
| translations/security.hu.xlf | Convert security catalogue from XLIFF 1.2 → 2.0; correct header metadata. |
| translations/security.el.xlf | Fix trgLang and <file id> headers for Greek security catalogue. |
| translations/messages.uk.xlf | Fix <file id> header for Ukrainian messages catalogue. |
| translations/messages.tr.xlf | Fix trgLang and <file id> headers for Turkish messages catalogue. |
| translations/messages.pt_BR.xlf | Remove empty XLIFF 1.2 messages catalogue for pt_BR. |
| translations/messages.hu.xlf | Convert messages catalogue from XLIFF 1.2 → 2.0; correct header metadata. |
| translations/messages.el.xlf | Fix trgLang and <file id> headers for Greek messages catalogue. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bobvandevijver
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first of several PRs splitting up #3753, as requested. It contains no translated content changes—only file format and header metadata updates.
What this does
1. Converts six catalogues from XLIFF 1.2 to 2.0 (
34b8f5d)The rest of
translations/was already on XLIFF 2.0; these six catalogues were the remaining exceptions:messages.hu,security.hu,validators.husecurity.zh_CN,validators.zh_CNvalidators.pt_BRThe conversion was performed using Symfony's own
XliffFileLoaderandXliffFileDumper(xliff_version: 2.0,default_locale: en) rather than by hand, so the output matches whattranslation:extractwould generate. Unit IDs remain unchanged, since the XLIFF 1.2 files already used the same hashing algorithm.The
huandzh_CNcatalogues also incorrectly declaredsource-languageas their own target language. Since the source strings are English keys,srcLangis now correctly set toen.2. Corrects
trgLangand<file id>headers on eight catalogues (9488c42)messages.el,security.el,validators.eltrgLang="en",id="*.en"trgLang="el",id="*.el"messages.tr,security.tr,validators.trtrgLang="en",id="*.en"trgLang="tr",id="*.tr"messages.uk,validators.ukid="*.en"id="*.uk"Only the two affected header lines were modified in each file.
3. Removes the empty
messages.pt_BR.xlf(299b899)The file contained an empty
<body>with notrans-unitelements, so it never provided any translations. Allmessageskeys forpt_BRalready fell back to English.It was also the only catalogue that could not be converted to XLIFF 2.0, because the format requires
<file>to contain at least one child element.