Skip to content

Compile translations with polib instead of GNU gettext - #856

Merged
f213 merged 1 commit into
masterfrom
polib-compilemessages
Oct 13, 2026
Merged

f213 merged 1 commit into
masterfrom
polib-compilemessages

Conversation

@f213

@f213 f213 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Problem

CI needs GNU gettext only to run compilemessages. Installing it means either an apt cache, which is buggy (awalsh128/cache-apt-pkgs-action silently caches an empty archive when apt fails, upstream #166 and #221), or an uncached apt-get install, which slows every run down.

Solution

Compile the catalogues in pure Python. manage.py compilemessages is overridden in app to compile with polib, whose output matches msgfmt's. With nothing left to install, the apt step goes away and the buggy caching with it. gettext leaves the Docker image too.

GNU gettext is still needed on the developer's machine for makemessages.

🤖 Generated with Claude Code

compilemessages is overridden in app to compile the catalogues in LOCALE_PATHS with polib, so neither the image nor CI needs gettext. polib keeps Plural-Forms verbatim and skips fuzzy messages, matching msgfmt; Babel was rejected because it drops Plural-Forms and falls back to the English plural rule. makemessages still needs gettext locally.

The generated project's CI loses its apt step entirely: nothing else needed gettext or locales-all, and awalsh128/cache-apt-pkgs-action silently caches an empty archive when apt fails (upstream #166, #221).

Ported from fandsdev/medical-backend#804.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@f213
f213 merged commit e5e97ef into master Oct 13, 2026
3 checks passed
@f213
f213 deleted the polib-compilemessages branch October 13, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants