Skip to content

Fix: repair malformed plural entries in all translations so every language compiles again - #8

Merged
corecommit merged 3 commits into
corecommit:mainfrom
fuis18:main
Aug 9, 2026
Merged

Fix: repair malformed plural entries in all translations so every language compiles again#8
corecommit merged 3 commits into
corecommit:mainfrom
fuis18:main

Conversation

@fuis18

@fuis18 fuis18 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fix: repair malformed plural entries in all translations so every language compiles again

Summary

es.ts and ja.ts were dropping out of the launcher's language list (only their regional variants like es_UY / ja_KANJI showed up). Root cause: plural messages whose <numerusform> tags had been stored as escaped text (&lt;numerusform&gt;), which makes lrelease abort. The CI builds each .ts to .qm, and make_translation_index.py only lists languages ​​that produced a .qm — so every affected language silently vanished from the published index_v2.json.

This turned out to be systemic, not just es/ja: 25 files had the same corruption.

Changes

  1. New maintenance script tools/check_translations.py (no changes to build):
  • --check: audits every translations/*.ts — XML validity, escaped-plural blocks, missing (unfinished) and obsolete (vanished) counts, placeholder mismatches (%1, %n), and whether lrelease actually compiles each file (with the error reason when it doesn't).

  • --fix: repairs the corrupt blocks: unescapes &lt;numerusform&gt; 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, and en_GB.ts (the text-plural wrap case); changes are minimal and surgical (translate-the-flags only).

Effect

After the next translations.yml run, all 98 languages will be present in index_v2.json again — the launcher will show "Español", "日本語", etc. instead of only their variants.

Notes

  • The remaining placeholder_bad findings (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.
  • Follows CONTRIBUTING: <source> and message contexts untouched; only structure/<translation> repaired.

fuis18 added 3 commits August 8, 2026 14:37
…guage compiles agai

Only repair, do not generate new translations, do not complete missing
translations.
Fix broken text
@corecommit
corecommit merged commit f7ec410 into corecommit:main Aug 9, 2026
5 of 6 checks passed
@corecommit

Copy link
Copy Markdown
Owner

Thanks for fixing those, I didn't knew they were an error from prism's translation files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants