Add i18n infrastructure and pilot Italian translation slice - #594
Merged
Conversation
…switcher Lay the groundwork for translating Metron (#593): LANGUAGES/LOCALE_PATHS settings, LocaleMiddleware, the i18n template context processor, the set_language URL, and a cookie-based language switcher in the navbar. No user-facing strings are marked up for translation yet.
Wrap user-facing strings in base.html, the navbar/footer/messages partials, and the Issue model/form/view in gettext calls, converting view messages from f-strings to %-style formatting so they stay translatable. Generate and translate the pilot Italian catalog, and wire catalog compilation into the Containerfile build and CI. This proves the translation pipeline end-to-end on a representative slice before rolling it out to the rest of the app in batches.
GitHub Actions runners and the python:3.14-slim base image don't ship GNU gettext tools by default, which compilemessages needs, causing CI to fail with "Can't find msgfmt". Install it before compiling, and remove it again after the Containerfile build step to keep the runtime image slim.
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.
Summary
LANGUAGES/LOCALE_PATHSsettings,LocaleMiddleware, the i18n template context processor, aset_languageURL, and a cookie-based language switcher in the navbarbase.html, the navbar/footer/messages partials, and the Issue model/form/view — and generate a translated Italian catalog to prove the pipeline end-to-endContainerfilebuild and CI, so.postays the only committed artifact and.mois always built freshThis is a deliberately scoped first slice, not a full sweep — see #593 for the phased rollout plan covering the rest of the app.