build(docker): compile translation catalogs into the runtime image - #606
Open
hamza-56 wants to merge 1 commit into
Open
build(docker): compile translation catalogs into the runtime image#606hamza-56 wants to merge 1 commit into
hamza-56 wants to merge 1 commit into
Conversation
The runtime loads compiled .mo files, which are git-ignored build artifacts; without this the published image served English only. pybabel is a dev-group dependency that must not enter the runtime image, so a throwaway catalog stage compiles with the lockfile-pinned dev environment and the runtime stage copies only sparkth/locale. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 14, 2026
Contributor
Author
|
@claude-review |
Contributor
|
Claude finished @hamza-56's task in 2m 24s —— View job Review: compile translation catalogs into the runtime imageI traced the full build graph and the runtime translation-loading path. This is a clean, correct change — approving in spirit (I can't submit a formal approval).
Why it's correct
Non-blocking notes
VerdictCorrect, well-reasoned, and the multi-stage split is exactly the right pattern for keeping |
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.
Part of: Sparkth UI, emails, API errors, and AI-generated content are English-only
Layer 5 of the i18n stack (#601 → #602 → #603 → #604 → #606 → #607).
What
Compiles the translation catalogs into the published Docker image at build time, so a production deployment (docker-compose.prod.yml pulling ghcr.io) serves the translations without any operator step.
Changes
catalog-builderstage compiles the committed.pocatalogs with the lockfile-pinned dev environment (pybabel is a dev-group dependency that must not enter the runtime image); the runtime stage copies onlysparkth/locale, now holding the compiled.mofilesmake i18n.compilethemselvesHow to Test
docker build --target catalog-builder .— the build log showscompiling catalog sparkth/locale/{es,fr}/LC_MESSAGES/messages.po(verified locally, exit 0)make docker.build, then run it andcurl -s -X POST localhost:8000/api/v1/auth/login -H 'Content-Type: application/json' -H 'Accept-Language: es' -d '{"username":"ghost","password":"nope"}'→{"detail":"Usuario o contraseña incorrectos"}Notes
No new dependency and no runtime-image size change beyond the two
.mofiles; the dev group is installed only in the throwaway stage.docker-publish.ymlbuilds on push to main/tags, so PR CI does not exercise the Dockerfile; step 1 above is the local verification.This PR description was written with the assistance of an LLM (Claude).