Skip to content

[DOCS, FIX] Prepare the docs translation: locale parity checks and translation script fixes - #101

Merged
bnbong merged 1 commit into
devfrom
docs/i18n-prep
Dec 4, 2026
Merged

bnbong merged 1 commit into
devfrom
docs/i18n-prep

Conversation

@bnbong

@bnbong bnbong commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Requesting Merging

Description

Preparation for #100. Adds the checks and tooling every language pull request relies on. No page is translated here and the six locale trees are untouched.

Type of Change

  • BUG FIX
  • ADDING NEW TEMPLATE
  • FEATURE ADDED/UPDATED
  • HOTFIX
  • DELETING UNNECESSARY FEATURES
  • DOCUMENTATION & DEVOPS
  • Etc..

Test Environment

  • macOS, Python 3.12.4
  • tests/test_docs: 339 passed, 6 skipped (the six pending languages)
  • Full suite before the review fixes: 6554 passed, 42 skipped, coverage 98.25%; C locale, encoding-warning and Windows-simulation runs pass
  • python scripts/docs_blocks.py --check, mkdocs build --strict, pre-commit and actionlint on the changed workflow pass

Major Changes

Checks for translated languages

  • tests/test_docs/test_locale_parity.py compares each page of a translated language with the English page: same pages, front matter, generated blocks, code blocks, heading levels and ids, admonitions and tabs, table shape, images with alt text, link targets, working #fragment links, and translated prose.
  • The six languages are listed as pending in tests/test_docs/docs_support.py; each language pull request removes its entry, which turns the checks on for it.
  • English headings that other pages or redirects link to now carry explicit ids, so a translated heading keeps its anchor.

Generated tables

  • The joins, separators and sentence patterns of the generated reference tables moved into the per-language word table, so a language adds one entry. English output is unchanged.

Translation script and workflow

  • Front matter, code blocks and generated blocks are not sent to the API and come back unchanged; start/web-generator.md and changelog.md are skipped; line endings are kept; a page that fails makes the run exit non-zero.
  • The github provider is removed: GitHub Models was retired on 2026-07-30. The workflow no longer offers anthropic, which the script never supported. The unused scripts/translation_config.json and the anthropic dependency are removed.
  • Workflow inputs are passed through environment variables instead of being interpolated into the shell.

Docs

  • The translation guide describes the process and the checks. It no longer pulls the whole changelog into the built page.

Screenshots (optional)

Etc

  • Not run: the translation workflow on GitHub Actions and a real API translation.

Refs #100

🤖 Generated with Claude Code

…lation script fixes

- add checks that compare every translated language with the English
  pages (pages, code blocks, headings and ids, admonitions, tables,
  images, links, fragments, translated prose); the six languages are
  listed as pending until their pull request lands
- give linked English headings explicit ids so translated headings keep
  their anchors
- move the language-dependent words of the generated tables into HEADINGS
- translate.py: keep front matter, code and generated blocks out of the
  API call, skip hand-translated pages, keep line endings, exit non-zero
  when a page fails; drop the retired GitHub Models provider and the
  unused config file and anthropic dependency
- translation guide: describe the process and the checks; stop the page
  from including the whole changelog

Refs #100

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bnbong bnbong added the documentation Improvements or additions to documentation label Dec 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T06:21:44.351432Z cb9cdbb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bnbong
bnbong merged commit 6ca7630 into dev Dec 4, 2026
11 checks passed
@bnbong
bnbong deleted the docs/i18n-prep branch December 4, 2026 06:37
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