Skip to content

Commit

Permalink
chore(next): use custom i18n configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-jerry-ye committed Jan 15, 2025
1 parent 968cf87 commit 5a8be8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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
4 changes: 3 additions & 1 deletion next/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
# I18N based on Readthedocs Environment
# https://docs.readthedocs.io/en/stable/reference/environment-variables.html
import os
if os.getenv('READTHEDOCS_LANGUAGE') == 'zh-cn':
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

0 comments on commit 5a8be8a

Please sign in to comment.