feat: add support for wxl and apple xliff formats#18199
feat: add support for wxl and apple xliff formats#18199nijel merged 5 commits intoWeblateOrg:mainfrom
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (87.91%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds support for two new translate-toolkit-backed formats in Weblate: WiX Toolset WXL (as a convert-based monolingual format) and XLIFF 1.2 with Apple extensions (as a TTKit format), along with tests and documentation updates.
Changes:
- Introduce
WXLFormat(convert-based) and integrate WXL conversion/saving logic. - Add
AppleXliffFormatwith zero-based CLDR plural handling shared via a new mixin. - Add/adjust tests and documentation pages + changelog entry.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| weblate/trans/tests/data/cs-cz.wxl | Adds a WXL fixture used by conversion tests and docs. |
| weblate/formats/ttkit.py | Adds Apple XLIFF format + shared plural mixin; refactors Stringsdict plural handling to reuse it. |
| weblate/formats/tests/test_formats.py | Registers a basic test class for the new Apple XLIFF format. |
| weblate/formats/tests/test_convert.py | Adds conversion round-trip tests for WXL; tweaks convert test diff output. |
| weblate/formats/models.py | Registers Apple XLIFF format in the formats list. |
| weblate/formats/convert.py | Adds WXL parser/serializer integration and generalizes convert_to_po to read from configurable unit attributes. |
| weblate/formats/base.py | Adds get_language_bcp_long_lower() to support lowercase long BCP language codes. |
| docs/formats/xliff.rst | Documents the new Apple XLIFF variant. |
| docs/formats/wxl.rst | New documentation page for the WXL format. |
| docs/changes.rst | Changelog entry mentioning the newly supported formats. |
weblate/trans/tests/data/cs-cz.wxl
Outdated
| @@ -0,0 +1,7 @@ | |||
| <?xml version='1.0' encoding='utf-8'?> | |||
| <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="de-de" Codepage="65001"> | |||
There was a problem hiding this comment.
The example/test WXL file is named cs-cz.wxl, but the root Culture attribute is set to de-de. This is confusing for both documentation and tests; consider aligning Culture with the filename/language being exercised (e.g. cs-cz).
| <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="de-de" Codepage="65001"> | |
| <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="cs-cz" Codepage="65001"> |
These were rencently introduced to the translate-toolkit.
These were rencently introduced to the translate-toolkit.