Fix: repair malformed plural entries in all translations so every language compiles again - #8
Merged
Merged
Conversation
…guage compiles agai Only repair, do not generate new translations, do not complete missing translations. Fix broken text
Owner
|
Thanks for fixing those, I didn't knew they were an error from prism's translation files |
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.
Fix: repair malformed plural entries in all translations so every language compiles again
Summary
es.tsandja.tswere dropping out of the launcher's language list (only their regional variants likees_UY/ja_KANJIshowed up). Root cause: plural messages whose<numerusform>tags had been stored as escaped text (<numerusform>), which makeslreleaseabort. The CI builds each.tsto.qm, andmake_translation_index.pyonly lists languages that produced a.qm— so every affected language silently vanished from the publishedindex_v2.json.This turned out to be systemic, not just es/ja: 25 files had the same corruption.
Changes
tools/check_translations.py(no changes to build):--check: audits everytranslations/*.ts— XML validity, escaped-plural blocks, missing (unfinished) and obsolete (vanished) counts, placeholder mismatches (%1,%n), and whetherlreleaseactually compiles each file (with the error reason when it doesn't).--fix: repairs the corrupt blocks: unescapes<numerusform>back to real tags, ensures the plural attribute is set, and wraps plain-text plural translations into<numerusform>.Repaired 25 files:
az, cs, da, de, en_AU, en_CA, en_GB, fr, ga, hu, id, it, ja, ko, nl, pl, pt_BR, pt_PT, ro, sq, sv, tr, uk, vi, zh, zh_TW.How I verified it
python3 tools/check_translations.py --fix
python3 tools/check_translations.py --check
xml=FAULT: 0
lrelease: 98/98 compile — previously ~25 failed
I spot-checked the diffs of
ja.ts,de.ts, anden_GB.ts(the text-plural wrap case); changes are minimal and surgical (translate-the-flags only).Effect
After the next
translations.ymlrun, all 98 languages will be present inindex_v2.jsonagain — the launcher will show "Español", "日本語", etc. instead of only their variants.Notes
placeholder_badfindings (a few dozen strings that drop to%1/%n) are content-quality, not build-blocking — they need translator review, so they were left for contributors rather than auto-repaired.<source>and message contexts untouched; only structure/<translation>repaired.