Skip to content

Configure docs as three Read the Docs translation projects#76

Merged
JE-Chen merged 1 commit intomainfrom
dev
Apr 28, 2026
Merged

Configure docs as three Read the Docs translation projects#76
JE-Chen merged 1 commit intomainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented Apr 28, 2026

Summary

The previous PR shipped a homepage rewrite, but only the English source tree was wired up on Read the Docs — relative ../html-zh-TW/index.html switcher links 404 on the public site because the two Chinese sources are never built or deployed. This PR follows RTD's prescribed multi-language layout: one project per language, linked under a main project's Translations tab.

  • Added .readthedocs.zh-TW.yaml and .readthedocs.zh-CN.yaml so each Sphinx source tree builds as its own RTD project.
  • Annotated the existing .readthedocs.yaml as the English (main) project config.
  • Set language = "en" on docs/source/conf.py (was implicit) and pulled html_baseurl from READTHEDOCS_CANONICAL_URL on every conf.py so canonical link tags match the per-language URL RTD serves.
  • Replaced the relative ../html-*/index.html switcher with absolute https://fileautomation.readthedocs.io/<lang>/latest/ URLs and added a brief note pointing at RTD's built-in language flyout.

Commits in this PR

  • 5bf51c3 Configure docs as three Read the Docs translation projects

Required RTD admin steps after merge

Config alone can't create projects — these steps must happen on https://readthedocs.org:

  1. Create three projects all pointing at this repo:
    • fileautomation (main, English)
    • fileautomation-zh-tw (Traditional Chinese)
    • fileautomation-zh-cn (Simplified Chinese)
  2. For each translation project: Settings → Default settings → Path for .readthedocs.yaml = .readthedocs.zh-TW.yaml / .readthedocs.zh-CN.yaml. Set Language to Traditional Chinese / Simplified Chinese.
  3. On the main fileautomation project, open the Translations tab and link the two translation projects. RTD then serves them at /zh_TW/ and /zh_CN/ and adds an automatic language selector to the version flyout on every page.

Test plan

  • All three local Sphinx builds succeed with no new toctree / index warnings:
    py -m sphinx -b html docs/source docs/_build/html
    py -m sphinx -b html docs/source.zh-TW docs/_build/html-zh-TW
    py -m sphinx -b html docs/source.zh-CN docs/_build/html-zh-CN
  • Verify the rendered homepage of each language has the absolute https://fileautomation.readthedocs.io/<lang>/latest/ switcher links.
  • After RTD admin steps: confirm the public site at https://fileautomation.readthedocs.io/en/latest/ shows the language flyout and the in-page switcher links navigate between /en/, /zh_TW/, and /zh_CN/.

Read the Docs's prescribed multi-language layout is one project per
language linked under a main project's Translations tab. Add the
two missing translation configs (.readthedocs.zh-TW.yaml,
.readthedocs.zh-CN.yaml) so each Sphinx source tree builds as its
own RTD project. Set language explicitly on every conf.py and pull
html_baseurl from READTHEDOCS_CANONICAL_URL so canonical link tags
match the per-language URL RTD serves.

Replace the relative ../html-*/index.html switcher links with
absolute https://fileautomation.readthedocs.io/<lang>/latest/ URLs
so cross-language navigation works on the public site (the relative
form 404s because only the English source was built on RTD), and
add a brief note pointing to RTD's built-in language flyout.
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit f8eddb0 into main Apr 28, 2026
8 checks passed
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant