Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(i18n): translate some extra stuff #423

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions document.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"options": {
"env": {
"SPHINXBUILD": "sphinx-autobuild",
"SPHINXOPTS": "-D language='${input:language}'"
"LANGUAGE": "${input:language}"
},
"cwd": "${workspaceFolder:document}"
},
Expand All @@ -41,7 +41,7 @@
],
"options": {
"env": {
"SPHINXOPTS": "-D language='${input:language}'"
"LANGUAGE": "${input:language}"
},
"cwd": "${workspaceFolder:document}"
},
Expand Down
2 changes: 1 addition & 1 deletion next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ python3 -m http.server -d _build/html
For Chinese version:

```bash
make -e SPHINXOPTS="-D language='zh_CN'" html
LANGUAGE="zh_CN" make html
python3 -m http.server -d _build/html
```

Expand Down
16 changes: 13 additions & 3 deletions next/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'MoonBit Document'
copyright = '2025, International Digital Economy Academy'
project = 'MoonBit'
author = 'International Digital Economy Academy'
copyright = '%Y, {author}'.format(author=author)
release = 'v0.1.20250113'

# I18N based on Readthedocs Environment
# https://docs.readthedocs.io/en/stable/reference/environment-variables.html
import os
if (os.getenv('READTHEDOCS_LANGUAGE') == 'zh-cn' or
os.getenv('LANGUAGE') == 'zh_CN'): # For local build
project = 'MoonBit 月兔'
author = '粤港澳大湾区数字经济院'
copyright = '%Y, {author}'.format(author=author)
language = 'zh_CN'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

Expand Down Expand Up @@ -39,7 +49,7 @@
"use_edit_page_button": True,
"use_issues_button": True,
"logo": {
"text":"MoonBit Documentation",
"text":"MoonBit 月兔",
}
}
html_logo = "_static/logo.png"
Expand Down
Loading