Roll out i18n markup across all remaining apps - #597
Merged
Conversation
Wrap the Timeline page title and the six DRF serializer ValidationError f-strings (collection, issue, wish_list) in gettext calls, converting them to %-style formatting so they stay translatable. Regenerate and translate the Italian catalog. Part of the phased i18n rollout (#593).
Wrap templates, views, forms, and model verbose_names in polls and pull_list in gettext/blocktrans calls. Vote counts use proper {% blocktrans count %} pluralization rather than the informal (s) suffix pattern, and view messages/HttpResponse strings are converted from f-strings to %-style formatting so they stay translatable. Regenerate and translate the Italian catalog.
Wrap templates, views, forms, and model verbose_names/help_texts/ choices in wish_list and user_collection in gettext/blocktrans calls, including the 25-entry CGC grade scale and book format/grading company choices. Use ngettext for the dual-pluralization case in AddIssuesFromSeriesView (independently pluralizable added/skipped counts) rather than conflating them into one count. Regenerate and translate the Italian catalog (317 new strings).
Wrap templates, views, forms, and model verbose_names/help_texts/ choices in the users app in gettext/blocktrans calls, including both formats of the account activation email. Split static HTML labels from translatable text where they were embedded together (e.g. the "Button not working?" lead-in), and escape translated strings interpolated into inline JS (api_token.html's revoke confirm() and copy-to-clipboard feedback) via {% filter escapejs %}. Regenerate and translate the Italian catalog (202 new strings).
Wrap templates, views, forms, and model verbose_names/help_texts/ choices in gettext/blocktrans calls, using ngettext for the independently-pluralizable added/reordered/skipped counts in the autocomplete add-issue flow. Fix a bug this surfaced: joining gettext_lazy proxies with str.join() raises TypeError, unlike %-formatting which coerces them implicitly - wrap with str() at the featured_creators roles join site. Regenerate and translate theItalian catalog (191 new strings).
Marks up the entire comicsdb app (models, forms, views, all 58 templates) plus the remaining global templates and the throttle notice/enforcement emails deferred from earlier phases as the hardest pluralization case. Fixes a Series.Status choices gap missed since Phase 1 (auto-generated labels aren't translatable without an explicit gettext-wrapped label).
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
Completes Phase 2 of the internationalization effort (#593), building on the Phase 0/1 infrastructure and pilot slice from #594. Marks up every remaining app for translation and expands the Italian catalog from the pilot's ~108 entries to 1,419 fully translated, zero-fuzzy entries.
Batches (2a–2h), smallest app first:
timeline,api— incl. 6 DRF serializerValidationErrorspolls,pull_listwish_list,user_collectionusers— incl. the account activation emailreading_liststemplates/— error pages, form widget overridescomicsdb— the whole app: models, forms, views, and all 58 templatesapithrottle notice/enforcement emails — deliberately saved for last as the hardest case, restructuring nestedpluralize/ifconditionals into properngettext-styleblocktrans countblocksNotable fixes found along the way:
Series.Statusused Django's auto-generated choice labels, which aren't translatable without an explicitgettext-wrapped label — fixed incomicsdb/models/series.py.issue_detail.html/issue_form.htmlhad their Python side (model/form/view) marked up in Phase 1 but the templates themselves were never touched — closed that gap here.blocktrans countblock with mismatched singular/plural placeholder names is a fatalxgettexterror, not a silent failure — caught and fixed.{% trans %}doesn't support multi-line string literals the way{% blocktrans %}does; it silently renders the tag literally instead of raising. Standardized on{% blocktrans %}for any wrapped string.