Repository navigation
Compile translations with polib instead of GNU gettext - #856
Merged
Merged
Conversation
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>
kazqvaizer
approved these changes
Oct 13, 2026
nvo87
approved these changes
Oct 13, 2026
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.
Problem
CI needs GNU gettext only to run
compilemessages. Installing it means either an apt cache, which is buggy (awalsh128/cache-apt-pkgs-actionsilently caches an empty archive when apt fails, upstream #166 and #221), or an uncachedapt-get install, which slows every run down.Solution
Compile the catalogues in pure Python.
manage.py compilemessagesis overridden inappto compile with polib, whose output matchesmsgfmt's. With nothing left to install, the apt step goes away and the buggy caching with it.gettextleaves the Docker image too.GNU gettext is still needed on the developer's machine for
makemessages.🤖 Generated with Claude Code