G
YouTube TikTok Games
Skip to content

docs(i18n): restore icons in translated card titles - #555

Merged
PierreRaybaut merged 2 commits into
developfrom
docs/536-translated-card-icons
Nov 13, 2026
Merged

PierreRaybaut merged 2 commits into
developfrom
docs/536-translated-card-icons

Conversation

@PierreRaybaut

@PierreRaybaut PierreRaybaut commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #536

Summary

French translations replaced the entire card title, including its icon. sphinx-design 0.7 extracts generated SVG in gettext keys, whereas 0.8 excludes icons and can reuse unrelated plain-text translations. Shared reST substitutions now give both versions identical, icon-specific keys. Translated cards retain the same icons as English cards without changes to the Sphinx engine or dependency requirements.

Changes

  • Migrate all 41 icon-bearing titles in six pages to |card-icon-NAME| substitutions, defined in doc/_card_icons.txt and included by those pages.
  • Migrate their gettext keys and preserve substitution delimiters in 35 translated titles; keep intentionally untranslated entries empty. The substitution-specific keys do not collide with plain-text translations elsewhere.
  • Correct the translation convention: preserve substitution delimiters, never copy generated SVG into msgstr.
  • Add doc/check_card_icons.py and run it after both HTML builds in documentation CI. It compares title counts and complete SVG markup, and fails explicitly on missing or changed icons.
  • Add a user-facing entry to the 1.4.1 documentation release notes with its French translation.

Validation

  • Regression demonstrated against the pre-fix French build: contributing/index.html: card title 1 has missing or changed icons (English: 1, French: 0); exit code 1.
  • Corrected builds: 41 identical icons in 50 card titles across eight pages, including icon-free titles.
  • Fresh gettext extraction and English/French HTML builds pass with -E -W under both sphinx-design 0.7.0 and an isolated 0.8.0 installation. Translation compilation passes.
  • All 41 gettext keys are identical across 0.7 and 0.8 and match the catalogs; all French card-title text is translated as intended or intentionally unchanged in both builds.
  • SVG markup is identical between English/French builds and between 0.7/0.8 English builds. Non-card icons were checked during prototyping.
  • The French release note is present in the rendered HTML.
  • Ruff formatting and linting pass for the new script; CI-selection tests: 15 passed.
  • Browser validation during prototyping: all eight French home-page icons are visible, with nonzero dimensions and themed fill.
  • The user waived a renewed manual-validation stop. No additional manual light/dark theme matrix was performed.
  • The first CI run passed all four Python/Qt test jobs; the new icon check exposed the 0.8 incompatibility. After the user's approval, the substitution-based adaptation was implemented and validated with both versions.

Out of scope

None. No application behavior, dependency requirements or release publication changes.

Assisted-by: GPT-6.1 Sol

French card translations replaced the whole title, including the SVG
generated by sphinx-design. Keep the original octicon role in translated
titles so Sphinx regenerates the icon without displaying escaped SVG.

- Restore 35 translated titles across six documentation catalogs
- Correct the translation convention and preserve untranslated entries
- Compare English and French card SVGs in documentation CI
- Add the 1.4.1 release note and its French translation

Closes #536

Assisted-by: GPT-6.1 Sol
@PierreRaybaut PierreRaybaut added this to the v1.4.1 milestone Nov 13, 2026
@PierreRaybaut PierreRaybaut added the documentation Improvements or additions to documentation label Nov 13, 2026
sphinx-design 0.8 no longer includes SVG in gettext keys, so card titles
can collide with plain-text translations and lose their icons even when
the SVG-based translations are fixed for 0.7.

- Use shared reST substitutions in all 41 icon-bearing card titles
- Migrate catalog keys and preserve substitution delimiters in translations
- Validate identical gettext keys and card SVGs with versions 0.7 and 0.8

Closes #536

Assisted-by: GPT-6.1 Sol
@PierreRaybaut
PierreRaybaut merged commit 5fa49e1 into develop Nov 13, 2026
8 checks passed
@PierreRaybaut
PierreRaybaut deleted the docs/536-translated-card-icons branch November 13, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant