Repository navigation
Make the remaining template text translatable (#476) - #1016
Merged
Merged
Conversation
- collection.jinja2: replace the msgids built at runtime ("Jandig " +
element_type + "s", "All " + ...) with literal ones in a lookup table,
so pybabel extracts them and msgmerge no longer marks them obsolete.
- upload-object.jinja2: pass the "Thumbnail" and "Generate Thumbnail"
labels to the thumbnail preview script from Jinja.
- Password reset pages: wrap the hardcoded headings, labels,
placeholders, buttons, links and messages in _(), reusing the
existing "E-mail", "Submit" and "New Password" msgids.
- pt_BR and es_ES: add translations for the new msgids and point the
collection entries at their template lines instead of the "Built at
runtime" translator comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #1007 and #1013 for #476: some English on the site could not be translated from the catalogs alone, because the templates either built msgids at runtime or did not wrap the text in
_().Changes
core/collection.jinja2: the headings and "All …" links used_("Jandig " + element_type.capitalize() + "s")and_("All " + …). pybabel cannot extract those, so the nextmake translate_*would have marked the catalog entries obsolete. They are now literal msgids in a lookup table keyed by element type (the AR/MR exhibit branches fold into the same table). The msgids are unchanged, so existing translations still apply.core/upload-object.jinja2: the thumbnail preview script wrote "Thumbnail" and "Generate Thumbnail" in English. The strings now come from Jinja via{{ _("…")|tojson }}, and the heading is set withtextContentrather thaninnerHTML.password_reset,password_reset_confirm,password_reset_complete): the headings, the label, placeholders, buttons, links and the "invalid link" and "password has been set" messages are wrapped in_(). The existingE-mail,SubmitandNew Passwordmsgids are reused. The "password has been set" sentence keeps its link inside one msgid (%(url)s), so translators see the whole sentence.locale/pt_BR,locale/es_ES: added Brazilian Portuguese and Spanish translations for the 14 new msgids. The collection entries now point at their template lines in place of the "Built at runtime" translator comment. Both catalogs were checked with polib: 0 untranslated, 0 fuzzy, placeholders match.The draft privacy policy is left untranslated on purpose (pending legal review).
Verification
extract_translationsfinds all the new msgids. Also rendered the lookup table, thetojsonoutput and the%(url)slink.ruff check --extend-select I src/andruff format --check src/pass.🤖 Generated with Claude Code