Repository navigation
Conversation
|
cc @soft-suroleb, please take a look :) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1316 +/- ##
==========================================
+ Coverage 93.67% 93.99% +0.32%
==========================================
Files 27 27
Lines 4983 4999 +16
==========================================
+ Hits 4668 4699 +31
+ Misses 315 300 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e924d32 to
bf8af98
Compare
1201386 to
4200364
Compare
There was a problem hiding this comment.
🟡 Changes recommended
An active moderate defect in Catalog.setitem can discard an existing singular translation when upgrading to a plural entry, so the change is not yet safe to approve.
1 open issue
What changed in this PR
This pull request follows up on #1161 with fixes for PO catalog concatenation, compendium merging, conflict serialization, encoding, and legacy catalog compatibility.
Changes:
- Improve handling of contextual, plural, untranslated, fuzzy, and conflicting messages.
- Refine compendium matching and translation application.
- Preserve catalog headers and support binary PO input.
- Add regression coverage and compatibility handling for catalogs without conflict metadata.
- Update coverage exclusions.
| File | Summary |
|---|---|
tests/messages/utils.py |
Adds helpers for creating PO files and executing catalog commands. |
tests/messages/test_pofile_write.py |
Tests writing catalogs without conflict metadata. |
tests/messages/frontend/test_merge.py |
Adds coverage for compendium matching, encoding, CLI behavior, and header handling. |
tests/messages/frontend/test_concat.py |
Adds coverage for contexts, plural conflicts, headers, translations, and fuzzy flags. |
babel/messages/pofile.py |
Reworks conflict serialization while preserving plural and contextual data. |
babel/messages/frontend.py |
Updates concatenation and compendium merge logic, including translation and header handling. |
babel/messages/catalog.py |
Clones conflict messages and tolerates catalogs without conflict-tracking state. |
.coveragerc |
Adjusts coverage exclusions for typing-only code and option-error paths. |
Review effort: Lite
|
ping @soft-suroleb :) |
Fixes using non-UTF-8 catalogs.
4200364 to
b2d700d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Binary reads fail on POT files declaring charset=CHARSET, and --use-first can discard an existing translation while allowing an unreviewed fuzzy plural translation to compile normally.
2 open issues
1 resolved since last review
Review effort: Balanced
| with open(filename, 'rb') as pofile: | ||
| template = read_po(pofile) |
| # the first form (like GNU msgcat), but mark it fuzzy. | ||
| stored.string = (message.string, *([''] * (len(stored.string) - 1))) | ||
| was_fuzzy = True | ||
| elif was_translated and was_singular and stored.pluralizable and not translated: |
* Match compendium entries by context, and key the obsoleted translation replaced under --compendium-overwrite by context too. * Keep a compendium entry's fuzzy flag instead of clearing it. * Don't apply a compendium entry across pluralization. * Recognize untranslated plural messages * Skip untranslated compendium entries; they used to wipe out existing fuzzy translations.
b2d700d to
89788a1
Compare


Follows up on #1161 with some bugfixes and clarifications.