Skip to content

XLIFF format normalisation: convert remaining 1.2 catalogues to 2.0 - #3770

Merged
bobvandevijver merged 4 commits into
bolt:6.1from
Vondry:fix/xliff-format-normalization
Aug 3, 2026
Merged

XLIFF format normalisation: convert remaining 1.2 catalogues to 2.0#3770
bobvandevijver merged 4 commits into
bolt:6.1from
Vondry:fix/xliff-format-normalization

Conversation

@Vondry

@Vondry Vondry commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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.hu
  • security.zh_CN, validators.zh_CN
  • validators.pt_BR

The conversion was performed using Symfony's own XliffFileLoader and XliffFileDumper (xliff_version: 2.0, default_locale: en) rather than by hand, so the output matches what translation:extract would generate. Unit IDs remain unchanged, since the XLIFF 1.2 files already used the same hashing algorithm.

The hu and zh_CN catalogues also incorrectly declared source-language as their own target language. Since the source strings are English keys, srcLang is now correctly set to en.

2. Corrects trgLang and <file id> headers on eight catalogues (9488c42)

File(s) Was Now
messages.el, security.el, validators.el trgLang="en", id="*.en" trgLang="el", id="*.el"
messages.tr, security.tr, validators.tr trgLang="en", id="*.en" trgLang="tr", id="*.tr"
messages.uk, validators.uk id="*.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 no trans-unit elements, so it never provided any translations. All messages keys for pt_BR already 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.

Note for reviewers: this is why pt_BR no longer has a messages catalogue. No translations were removed—there were never any in that file.

Vondry added 3 commits August 3, 2026 16:33
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_BR variants) to XLIFF 2.0 and update headers (srcLang/trgLang, <file id>) accordingly.
  • Fix incorrect trgLang / <file id> headers in existing XLIFF 2.0 catalogues for el, tr, and uk.
  • Remove the empty messages.pt_BR.xlf catalogue.

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.

Comment thread translations/messages.uk.xlf Outdated
Comment thread translations/validators.uk.xlf Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bobvandevijver
bobvandevijver merged commit ed04cc3 into bolt:6.1 Aug 3, 2026
36 of 38 checks passed
@bobvandevijver bobvandevijver added this to the Bolt 6.1 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants