Skip to content

[GH-2867] Wire mkdocs-static-i18n for Chinese documentation#2920

Merged
jiayuasu merged 1 commit intoapache:masterfrom
jiayuasu:feature/docs-i18n-scaffolding
May 7, 2026
Merged

[GH-2867] Wire mkdocs-static-i18n for Chinese documentation#2920
jiayuasu merged 1 commit intoapache:masterfrom
jiayuasu:feature/docs-i18n-scaffolding

Conversation

@jiayuasu
Copy link
Copy Markdown
Member

@jiayuasu jiayuasu commented May 7, 2026

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

Phase 1 of the EPIC #2867 — wires up the mkdocs-static-i18n plugin so the docs site can serve a Chinese (zh) version alongside English. The default locale stays English and pages without a *.zh.md translation fall back to the English content automatically, so subsequent translation PRs can land incrementally per section.

  • Register mkdocs-static-i18n in the docs dependency group in pyproject.toml
  • Configure suffix-mode i18n in mkdocs.yml (file.zh.md next to file.md) with reconfigure_material and reconfigure_search so the language switcher appears in the header and search indexes both locales
  • Translate ~120 top-level navigation labels (Install, Programming Guide, API, Community, etc.) for the zh build via nav_translations
  • Seed docs/index.zh.md so the Chinese tree builds with content; future PRs translate the rest

Translation lands as a series of follow-up PRs (#2909-#2919), one per documentation section, so each PR stays small and reviewable. See #2867 for the full checklist.

How was this patch tested?

Built the docs locally with uv sync --group docs && uv run mkdocs build and verified:

  • The build succeeds and reports Translated 120 navigation elements to 'zh'
  • site/ contains the English tree at root and a parallel site/zh/ tree
  • site/index.html contains <link rel="alternate" hreflang="en"> and hreflang="zh" tags (language switcher wired in the header)
  • site/zh/index.html shows the Chinese announcement bullets from index.zh.md
  • site/zh/sedonaspark/index.html falls back to the English content (since no sedonaspark.zh.md exists yet)
  • site/zh/index.html navigation shows translated labels (e.g. "安装", "编程指南", "发布说明")

Did this PR include necessary documentation updates?

  • Yes, this PR is itself a documentation infrastructure change. The homepage hero strings live in docs-overrides/main.html, not in index.md, so they will appear in English on the /zh/ homepage until Phase 2 ([GH-2867] Translate documentation landing pages to Chinese (Phase 2) #2909) makes the template locale-aware. Auto-generated content (R pkgdown under api/rdocs, Python Sphinx under api/pydocs, JavaDoc, ScalaDoc) stays English-only — those are produced from source comments, not Markdown.

Add the i18n plugin scaffolding so the docs site can serve a Chinese
(zh) version alongside English. The default locale stays English and
untranslated pages fall back to English content automatically, so
translation can land incrementally per section.

- Register mkdocs-static-i18n in the docs dependency group
- Configure suffix-mode i18n (file.zh.md) with reconfigure_material
  and reconfigure_search so the language switcher and search index
  pick up both locales
- Translate top-level navigation labels (Install, Programming Guide,
  API, Community, etc.) for the zh build
- Seed docs/index.zh.md so the Chinese tree builds with content

Subsequent PRs translate individual sections (landing pages, setup,
tutorial, API reference, community).
@jiayuasu jiayuasu force-pushed the feature/docs-i18n-scaffolding branch from b4b349d to 9a39bf9 Compare May 7, 2026 00:58
@jiayuasu jiayuasu requested a review from Copilot May 7, 2026 00:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Wires mkdocs-static-i18n into the MkDocs documentation build so the site can publish a Chinese (zh) locale alongside English using suffix-mode files (*.zh.md) with fallback to English when translations are missing.

Changes:

  • Added mkdocs-static-i18n to the docs dependency group in pyproject.toml.
  • Configured mkdocs-static-i18n in mkdocs.yml (suffix structure, fallback enabled, Material + search reconfiguration) and provided zh navigation label translations.
  • Seeded a Chinese homepage at docs/index.zh.md to ensure the /zh/ tree builds with content.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pyproject.toml Adds the i18n plugin dependency to the docs environment used by CI/local builds.
mkdocs.yml Enables suffix-mode i18n, configures en/zh builds, and provides zh nav label translations.
docs/index.zh.md Seeds initial Chinese homepage content so the zh locale has a concrete landing page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jiayuasu jiayuasu modified the milestone: sedona-1.9.1 May 7, 2026
@jiayuasu jiayuasu merged commit 3b5de9f into apache:master May 7, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants