Skip to content

Read .po catalogs with #~| obsolete entries (gettext-parser 9) - #117

Merged
arvida merged 1 commit into
mainfrom
fix/828-gettext-parser-9
Oct 8, 2026
Merged

arvida merged 1 commit into
mainfrom
fix/828-gettext-parser-9

Conversation

@arvida

@arvida arvida commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Fixes localheroai/localhero-ai#828.

msgmerge writes #~| msgid "..." for obsolete entries when run with --previous, which Django's makemessages does by default. gettext-parser 8.0.0 throws Invalid key name "|" on those lines, so the whole catalog was unreadable: check reported the language as not checked and exited 0, and translate (same parsePoFile via files.ts) could not read it. Hit zulip, bookwyrm and zammad in a 40-repo run.

Upgrades to gettext-parser 9.1.1, which parses #~| (added in 9.1.0). 9.x needs Node 20, so engines moves from >=18 to >=20; the Localhero Action runs Node 22 and init's manual workflow uses Node 20. The upgrade also drops readable-stream and 9 other transitive dependencies.

Verified

  • New test fails on 8.0.0, passes on 9.1.1. Full suite passes, lint and build clean.
  • 359 real .po files from customer and demo repos: identical translations on 8.0.0, 9.1.0 and 9.1.1, and byte-identical output after parse + po.compile with foldLength: 0 (the call in po-utils.ts).
  • Review (code-reviewer agent): API and return shapes unchanged; 9.1.1 is strictly more permissive than 8.0.0 (only #~| added; stray | still throws as before); lockfile changes only gettext-parser and the removed stream deps, integrity hash checked.
  • Built CLI: zulip now completes where it crashed; a minimal #~| catalog is checked instead of skipped.

- gettext-parser 8.0.0 rejected the whole file on #~| lines, which msgmerge --previous (Django makemessages' default) writes for obsolete entries
- Upgrade to 9.1.1; it drops readable-stream, so ten transitive dependencies go
- Requires Node 20 (the Action runs 22, init's manual setup uses 20)
@arvida
arvida force-pushed the fix/828-gettext-parser-9 branch from 2942fe2 to 4d5cbef Compare October 8, 2026 08:20
@arvida
arvida merged commit 6463103 into main Oct 8, 2026
1 check passed
@arvida arvida mentioned this pull request Oct 8, 2026
arvida added a commit that referenced this pull request Oct 8, 2026
- Monorepo syncs apply only in the app they belong to (#119)
- .po catalogs with #~| obsolete entries are read (#117);
  requires Node.js 20
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.

1 participant