Skip to content

Roll out i18n markup across all remaining apps - #597

Merged
bpepple merged 6 commits into
masterfrom
translations-phase-2
Aug 13, 2026
Merged

Roll out i18n markup across all remaining apps#597
bpepple merged 6 commits into
masterfrom
translations-phase-2

Conversation

@bpepple

@bpepple bpepple commented Aug 13, 2026

Copy link
Copy Markdown
Member

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 serializer ValidationErrors
  • polls, pull_list
  • wish_list, user_collection
  • users — incl. the account activation email
  • reading_lists
  • Remaining global templates/ — error pages, form widget overrides
  • comicsdb — the whole app: models, forms, views, and all 58 templates
  • api throttle notice/enforcement emails — deliberately saved for last as the hardest case, restructuring nested pluralize/if conditionals into proper ngettext-style blocktrans count blocks

Notable fixes found along the way:

  • Series.Status used Django's auto-generated choice labels, which aren't translatable without an explicit gettext-wrapped label — fixed in comicsdb/models/series.py.
  • issue_detail.html/issue_form.html had their Python side (model/form/view) marked up in Phase 1 but the templates themselves were never touched — closed that gap here.
  • A blocktrans count block with mismatched singular/plural placeholder names is a fatal xgettext error, 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.

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).
@bpepple bpepple self-assigned this Aug 13, 2026
@bpepple bpepple added the chore Miscellaneous drudgery label Aug 13, 2026
@bpepple
bpepple merged commit 6dd9db9 into master Aug 13, 2026
2 checks passed
@bpepple
bpepple deleted the translations-phase-2 branch August 13, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Miscellaneous drudgery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant