[GH-2909] Translate documentation landing pages to Chinese#2922
Merged
jiayuasu merged 3 commits intoapache:masterfrom May 7, 2026
Merged
[GH-2909] Translate documentation landing pages to Chinese#2922jiayuasu merged 3 commits intoapache:masterfrom
jiayuasu merged 3 commits intoapache:masterfrom
Conversation
Phase 2 of apache#2867. Translates the top-level landing pages and makes the homepage hero template locale-aware so Chinese visitors see translated content end-to-end on /zh/. - Add docs/sedonaspark.zh.md, sedonaflink.zh.md, sedonasnow.zh.md, download.zh.md - Refactor docs-overrides/main.html to source all hardcoded English strings (hero subtitle and CTA, deploy section, feature grid, industries tabs, community + events sections, outdated-version banner, announcement banner, decorative event line) from a per-locale translation dict keyed off config.theme.language. The default 'en' rendering is unchanged. - Broaden the homepage detection in main.html so the hero template is applied to both index.md and index.zh.md (mkdocs sets page.is_homepage only on the default-locale index). Verified locally with `uv run mkdocs build`: the /zh/ homepage now renders the full hero with Chinese strings, the four landing pages render in Chinese, and the English /index.html stays byte-identical in size to before.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Translates key documentation landing pages into Chinese and refactors the docs homepage template to render localized hero/landing content on /zh/.
Changes:
- Added Chinese versions of key landing pages (Spark/Flink/Snowflake/Download).
- Refactored
docs-overrides/main.htmlto use a per-locale translation dictionary driven byconfig.theme.language. - Adjusted homepage detection so the custom hero renders for both
index.mdandindex.zh.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/sedonaspark.zh.md | Adds Chinese translation for the SedonaSpark landing page. |
| docs/sedonaflink.zh.md | Adds Chinese translation for the SedonaFlink landing page. |
| docs/sedonasnow.zh.md | Adds Chinese translation for the SedonaSnow landing page. |
| docs/download.zh.md | Adds Chinese translation for the Download page, including version tables and links. |
| docs-overrides/main.html | Makes homepage hero + global banners locale-aware and renders hero on /zh/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{ t.get_started_desc }} | ||
| </div> | ||
| <div class="bth-group"> | ||
| <a href="/sedonadb" class="btn btn-red"> |
| <div class="info-item__description editor">Standalone runtime for local processing and development.</div> | ||
| <div class="info-item__description editor">{{ t.sedonadb_desc }}</div> | ||
| <div class="info-item__cta"> | ||
| <a href="/sedonadb" class="btn-link"> |
| } -%} | ||
| <div style="background: #CA463A; color: white; text-align: center; padding: 0.5rem;"> | ||
| <a href="setup/release-notes/" title="Announcement">Apache Sedona 1.9.0 is out now, featuring Spark 4.1 support, proj4sedona CRS transformation, Bing Tile functions, and more!</a> | ||
| <a href="setup/release-notes/" title="Announcement">{{ announcement[lang] }}</a> |
|
|
||
| {% block outdated %} | ||
| You're not viewing the latest stable version. | ||
| {%- set lang = config.theme.language if config.theme.language in ['en', 'zh'] else 'en' -%} |
| {% endblock %} | ||
|
|
||
| {% block header %} | ||
| {%- set lang = config.theme.language if config.theme.language in ['en', 'zh'] else 'en' -%} |
| {% if page.is_homepage %} | ||
| {% set is_home = page.is_homepage or (page.file and page.file.src_uri in ['index.md', 'index.zh.md']) %} | ||
| {% if is_home %} | ||
| {%- set lang = config.theme.language if config.theme.language in ['en', 'zh'] else 'en' -%} |
| <div>Sedona <strong>Events</strong></div> | ||
| <div>Sedona <strong>Events</strong></div> | ||
| <div>Sedona <strong>Events</strong></div> | ||
| {%- set events_decor = {'en': ['Sedona ', 'Events'], 'zh': ['Sedona ', '活动']} -%} |
| 'feature_portable_title': 'Portable', | ||
| 'feature_portable_desc': 'Easy to run locally, in the cloud, or with any data platform.', | ||
| 'feature_fast_title': 'Fast', | ||
| 'feature_fast_desc': 'Optimized execution for single node or distribute cluster environments.', |
Comment on lines
+38
to
+52
| | | 从 ASF 下载 | 校验和 | 签名 | | ||
| |:-----------------:|:----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:| | ||
| | 源代码 | [src](https://www.apache.org/dyn/closer.lua/sedona/1.9.0/apache-sedona-1.9.0-src.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-src.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-src.tar.gz.asc) | | ||
| | 二进制 | [bin](https://www.apache.org/dyn/closer.lua/sedona/1.9.0/apache-sedona-1.9.0-bin.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-bin.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-bin.tar.gz.asc) | | ||
|
|
||
| ### 1.8.1 | ||
|
|
||
| | | 从 ASF 下载 | 校验和 | 签名 | | ||
| |:-----------------:|:----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:| | ||
| | 源代码 | [src](https://www.apache.org/dyn/closer.lua/sedona/1.8.1/apache-sedona-1.8.1-src.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-src.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-src.tar.gz.asc) | | ||
| | 二进制 | [bin](https://www.apache.org/dyn/closer.lua/sedona/1.8.1/apache-sedona-1.8.1-bin.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-bin.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-bin.tar.gz.asc) | | ||
|
|
||
| ### 1.7.2 | ||
|
|
||
| | | 从 ASF 下载 | 校验和 | 签名 | |
Comment on lines
+35
to
+37
| sedona.createTemporaryView("myTable", tbl) | ||
| Table geomTbl = sedona.sqlQuery("SELECT ST_GeomFromWKT(geom_polygon) as geom_polygon, name_polygon FROM myTable") | ||
| geomTbl.execute().print() |
… paths
Two follow-up fixes for the Phase 2 landing-pages work:
1. Replace the default mkdocs-material dropdown language selector with
a visible inline pill switch (English | 中文) so the Chinese build
is discoverable from the orange header without opening a menu.
- Override `partials/alternate.html` with two anchor pills, the
active locale highlighted in white-on-brand-red.
- Add `_lang-switch.scss` with the pill styling.
- Set `target="_self"` on the anchors so mkdocs-material's
`navigation.instant` does not intercept the click; clicking the
switch now triggers a full page reload, which repaints the
header's active highlight along with the rest of the page (the
instant-nav DOM swap only refreshes a fixed list of components
and the language switcher is not in that list).
2. Fix images that were missing on every /zh/ page:
- In `docs-overrides/main.html` the homepage hero/deploy/feature/
industries/community sections referenced assets via raw paths
like `src="image/home/foo.svg"`, which under `/zh/` resolves to
`/zh/image/...` and 404s. Wrap all 44 `src="image/..."` paths
with the `| url` Jinja filter so mkdocs computes a properly
relative URL from any page depth.
- In `docs/sedonaspark.zh.md` the New York City water screenshot
was linked as `../image/nyc_base_water.png`. Switch to the
source-relative `image/nyc_base_water.png` so mkdocs auto-adjusts
the depth of the rendered relative URL per locale (English
renders `../image/...`, Chinese renders `../../image/...`, both
resolving to `/image/nyc_base_water.png`).
Three follow-ups from PR review:
1. Hoist the locale detection to a single top-level set in main.html
so the four blocks that need it stop recomputing
`config.theme.language` independently. Renamed the variable to
`cur_lang` to avoid the name collision with mkdocs-material's
`lang` (which base.html imports as a TemplateModule from
`partials/language.html`).
2. Fold the homepage `events_decor_pre`/`events_decor_strong`
strings into the main `i18n` translation dict alongside the
other locale-specific strings, instead of declaring them in
their own per-block `set` block.
3. Fix two real bugs uncovered while reviewing:
- The release-notes announcement banner used a relative href
(`setup/release-notes/`) that 404'd from any non-home page.
Wrap with the `| url` Jinja filter so mkdocs computes the
correct relative URL from any page depth.
- English `feature_fast_desc` had a grammar bug —
"distribute cluster" → "distributed cluster".
The `outdated_msg` and `announcement` dicts stay scoped to their
respective blocks because they're only referenced once each and
locality is easier to read than a giant top-level dict.
Member
Author
|
Addressed in 1339c4b:
Skipped (pre-existing patterns, not introduced by this PR):
|
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.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes [GH-2867] Translate documentation landing pages to Chinese (Phase 2) #2909, part of EPIC Add Chinese version of the documentation #2867.What changes were proposed in this PR?
Phase 2 of the Chinese-documentation EPIC (#2867). This PR translates the top-level landing pages and makes the homepage hero template locale-aware so Chinese visitors see translated content end-to-end on
/zh/.docs/sedonaspark.zh.md,docs/sedonaflink.zh.md,docs/sedonasnow.zh.md,docs/download.zh.md.docs-overrides/main.htmlto source all hardcoded English strings from a per-locale translation dict keyed offconfig.theme.language. The covered surfaces are:main.htmlso the hero template renders for bothindex.mdandindex.zh.md. mkdocs setspage.is_homepageonly on the default-locale index, so/zh/would otherwise fall through to plain markdown.How was this patch tested?
Built the docs locally with
uv sync --group docs && uv run mkdocs buildand verified:site/zh/index.htmlrenders the full hero template with translated strings (e.g.让处理任意规模的空间数据变得轻而易举,立即开始,加入社区,查看活动).site/index.htmlis byte-identical in line count to the previous English-only build (6,299 lines) — no regression on the default locale.site/zh/sedonaspark/index.html,site/zh/sedonaflink/index.html,site/zh/sedonasnow/index.html,site/zh/download/index.htmlrender the new Chinese content./zh/reads the Chinese string (Apache Sedona 1.9.0 已正式发布…).Did this PR include necessary documentation updates?