|
1 | | -# Lean prover community website |
| 1 | +# Lean 官方文档中文翻译 (Lean Documentation in Chinese) |
2 | 2 |
|
3 | | -The deployed website lives on the `master` branch of this repository. |
4 | | -To make changes to the website, please fork the repository and make a PR against the |
5 | | -[`lean4`](https://github.com/leanprover-community/leanprover-community.github.io/tree/lean4) |
6 | | -branch. |
7 | | -Once your PR is merged, CI will automatically deploy the changes to the `master` branch. |
| 3 | +[](链接到QQ加群) |
| 4 | +[](Telegram链接) |
| 5 | +[](https://github.com/lean-zh/lean-docs-zh) |
8 | 6 |
|
9 | | -## Dependencies |
| 7 | +欢迎来到 Lean 官方文档中文翻译项目! |
10 | 8 |
|
11 | | -* `pip install -r requirements.txt` |
| 9 | +本项目由 [Lean-zh 社区](https://github.com/lean-zh) 维护,致力于将 Lean 官方文档和社区资料翻译成中文,帮助更多中文使用者学习和使用 Lean 这一强大的交互式定理证明器。 |
12 | 10 |
|
13 | | -Building the bibliography requires [`bibtool`](https://github.com/ge-ne/bibtool). |
| 11 | +* **原文仓库**: [leanprover-community.github.io](https://github.com/leanprover-community/leanprover-community.github.io) |
| 12 | +* **在线阅读 (英文原版)**: [https://leanprover-community.github.io/](https://leanprover-community.github.io/) |
14 | 13 |
|
15 | | -In order to rebuild the CSS from SCSS, you also need: |
| 14 | +--- |
16 | 15 |
|
17 | | -* [sass](https://sass-lang.com/) |
18 | | -* [bootstrap](https://github.com/twbs/bootstrap/archive/v4.4.1.zip) |
19 | | - should be unpacked at the project root |
| 16 | +## 贡献指南 (Contribution Guide) |
20 | 17 |
|
21 | | -The website relies on several components which are built in other repositories: |
22 | | -- [`mathlib_stats`](https://github.com/leanprover-community/mathlib_stats) |
23 | | -- [`lean4web`](https://github.com/leanprover-community/lean4web) |
24 | | -- [`mathlib4_docs`](https://github.com/leanprover-community/mathlib4_docs) (built by CI in [doc-gen4](https://github.com/leanprover/doc-gen4/)) |
| 18 | +我们非常欢迎任何形式的贡献,无论是翻译新页面、校对现有翻译,还是改进本文档。每一份努力都会让 Lean 社区变得更好! |
25 | 19 |
|
26 | | -## Building |
| 20 | +### 沟通与协调 |
27 | 21 |
|
28 | | -* Build CSS if needed: `sass scss/lean.scss > css/lean.css` |
29 | | -* Build site using `make_site.py`. Use option `--local` for local |
30 | | - viewing (internal url will be prefixed by local file path). |
31 | | - Use option `--reload` to continuously build when templates are |
32 | | - changed (this won't work for watching changes in `data/`). |
| 22 | +在开始翻译之前,请务必: |
| 23 | +1. **查看下方的 [翻译进度表](#翻译进度),避免重复劳动。** |
| 24 | +2. 加入我们的 [QQ 群](链接到QQ加群) 或 [Telegram 频道](Telegram链接) 进行讨论,认领你感兴趣的翻译任务。 |
33 | 25 |
|
| 26 | +### 翻译流程 (简单三步) |
34 | 27 |
|
35 | | -If you want to retrieve the list of Zulip users to get the users map, the |
36 | | -environment variable `ZULIP_KEY` should be set with the Zulip API key of the |
37 | | -map scraper bot. |
| 28 | +我们采用标准的 GitHub Fork & Pull Request 流程,即使是新手也能轻松上手: |
38 | 29 |
|
39 | | -If you want to work on a new feature, there are several helpful tricks to know. |
| 30 | +1. **Fork 本仓库**: 点击右上角的 "Fork" 按钮,将此仓库复制到你的个人 GitHub 账号下。 |
| 31 | +2. **修改与翻译**: 在你 Fork 后的仓库中,可以直接通过 GitHub 网页界面找到想要翻译的文件并进行编辑。 |
| 32 | + * **目录结构**: 请确保你的翻译文件与[原仓库 `lean4` 分支](https://github.com/leanprover-community/leanprover-community.github.io/tree/lean4)中的目录结构保持一致。 |
| 33 | + * **翻译规范**: 请参考下方的翻译规范,以保证译文质量和风格统一。 |
| 34 | +3. **创建 Pull Request (PR)**: 完成翻译后,在你的仓库页面会自动出现一个 "Contribute" 按钮,点击 "Open pull request",按照提示将你的修改提交给我们审核。 |
40 | 35 |
|
41 | | -First you will very quickly hit the GitHub API rate limit without |
42 | | -authentication. You can |
43 | | -[create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) |
44 | | -and run `GITHUB_TOKEN=my_token_copied_from_github ./make_site --local` during |
45 | | -your experiments. |
| 36 | +对于更熟悉 Git 的用户,我们推荐使用[命令行流程](https://docs.github.com/zh/get-started/quickstart/contributing-to-projects)。 |
46 | 37 |
|
47 | | -You can also run the script once normally and then run |
48 | | -`NODOWNLOAD=1 ./make_site --local` to build the website using the information |
49 | | -previously downloaded. This information is stored into the `data_cache` folder. |
50 | | -If you need the script to download something but not everything you can |
51 | | -temporarily change the relevant `if DOWNLOAD:` into a `if not DOWNLOAD:`. |
| 38 | +### 翻译规范 |
52 | 39 |
|
53 | | -You can also choose to render only certain templates using |
54 | | -`./make_site --local --only my_template.html`. |
55 | | -This argument can actually be a regular expression, but giving one template |
56 | | -name is the most common use case. |
| 40 | +1. **术语表**: 对于专有名词,请参考我们的 **[术语表 (GLOSSARY.md)]()** (待创建)。 |
| 41 | + * **原则**: 保留常见的英文术语,如 `Lean`, `VS Code`, `lake`, `mathlib`, `git`, `Infoview` 等,不在正文中做强制翻译。 |
| 42 | + * 对于不常见的术语,可在首次出现时以括号形式标注原文,例如:“工具链 (toolchain)”。 |
| 43 | +2. **格式**: 请完整保留原文的 Markdown 格式,包括标题、代码块、列表、链接等。 |
| 44 | +3. **代码块**: 代码块(` ``` `)中的内容**不要翻译**,但代码注释可以翻译。 |
| 45 | +4. **语气**: 请尽量保持客观、准确、专业的风格,与原文档保持一致。 |
57 | 46 |
|
| 47 | +--- |
58 | 48 |
|
59 | | -## TODO |
| 49 | +## 翻译进度 |
60 | 50 |
|
61 | | -* Better integration with API docs |
62 | | -* Use webpack or similar to bundle all the javascript? |
| 51 | +在这里,你可以看到所有文档的翻译状态。欢迎在社区群中认领 "待翻译" 的任务! |
63 | 52 |
|
64 | | -## Lean 3 website |
| 53 | +(未启用) |
65 | 54 |
|
66 | | -The files and history for the leanprover-community Lean 3 website can be found in the |
67 | | -[`lean3`](https://github.com/leanprover-community/leanprover-community.github.io/tree/lean3) branch of this repo. |
| 55 | +| 原始文件路径 | 状态 | 负责人 | PR 链接 | |
| 56 | +|:---|:---:|:---:|:---:| |
| 57 | +| **Installation** | | | | |
| 58 | +| `templates/install/project.md` | ✅ 已完成 | @你的GitHub用户名 | [#1](链接到你的PR) | |
| 59 | +| `templates/install/windows.md` | 📝 待翻译 | | | |
| 60 | +| `templates/install/macos.md` | 📝 待翻译 | | | |
| 61 | +| `templates/install/linux.md` | 📝 待翻译 | | | |
| 62 | +| **Contributing** | | | | |
| 63 | +| `templates/contribute/index.md` | 📝 待翻译 | | | |
| 64 | +| `templates/contribute/githowto.md` | 📝 待翻译 | | | |
| 65 | +| ... (更多文件待添加) | | | | |
68 | 66 |
|
69 | | -## Old website |
| 67 | +**图例**: `📝 待翻译` | `正在翻译` | `🔍 待校对` | `✅ 已完成` |
70 | 68 |
|
71 | | -The files and history for the old leanprover-community website can be found in the |
72 | | -[`oldsite`](https://github.com/leanprover-community/leanprover-community.github.io/tree/oldsite) branch of this repo. |
| 69 | +--- |
| 70 | + |
| 71 | +## 本地预览与构建 (开发者指南) |
| 72 | + |
| 73 | +如果你希望在提交前于本地预览网站效果,或参与网站功能的开发,可以参考以下指南。 |
| 74 | + |
| 75 | +### 环境依赖 |
| 76 | + |
| 77 | +* 首先,安装 Python 依赖: |
| 78 | + ```bash |
| 79 | + pip install -r requirements.txt |
| 80 | + ``` |
| 81 | +* 构建参考文献需要安装 [`bibtool`](https://github.com/ge-ne/bibtool)。 |
| 82 | +* 如需从 SCSS 文件重建 CSS 样式,你还需要: |
| 83 | + * [sass](https://sass-lang.com/) |
| 84 | + * [bootstrap v4.4.1](https://github.com/twbs/bootstrap/archive/v4.4.1.zip) (应解压到项目根目录) |
| 85 | + |
| 86 | +### 构建网站 |
| 87 | + |
| 88 | +* 如果需要,先构建 CSS 文件: |
| 89 | + ```bash |
| 90 | + sass scss/lean.scss > css/lean.css |
| 91 | + ``` |
| 92 | +* 使用 `make_site.py` 脚本来构建网站。 |
| 93 | + * 用于**本地预览** (内部链接将使用本地文件路径): |
| 94 | + ```bash |
| 95 | + ./make_site.py --local |
| 96 | + ``` |
| 97 | + * 用于在模板更改时**持续构建** (此功能对 `data/` 目录的更改无效): |
| 98 | + ```bash |
| 99 | + ./make_site.py --reload |
| 100 | + ``` |
| 101 | + |
| 102 | +### 开发者提示 |
| 103 | + |
| 104 | +* **GitHub API 速率限制**: 在本地构建时,你可能会很快达到 GitHub API 的速率限制。你可以[创建一个个人访问令牌](https://docs.github.com/zh/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)并在运行时提供它: |
| 105 | + ```bash |
| 106 | + GITHUB_TOKEN=你的令牌 ./make_site.py --local |
| 107 | + ``` |
| 108 | +* **使用缓存**: 你可以正常运行一次脚本,之后使用 `NODOWNLOAD=1` 标志来利用已下载的缓存数据进行构建,以加快速度。缓存信息存储在 `data_cache` 文件夹中。 |
| 109 | + ```bash |
| 110 | + NODOWNLOAD=1 ./make_site.py --local |
| 111 | + ``` |
| 112 | +* **只渲染特定模板**: 你可以使用 `--only` 参数来只渲染特定的模板文件,这在调试单个页面时非常有用。 |
| 113 | + ```bash |
| 114 | + ./make_site.py --local --only my_template.html |
| 115 | + ``` |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## 关于其他分支 |
| 120 | + |
| 121 | +* **`lean3` 分支**: 包含 Lean 3 社区网站的文件和历史。 |
| 122 | +* **`oldsite` 分支**: 包含更早版本的社区网站文件和历史。 |
| 123 | + |
| 124 | +感谢你的贡献! |
0 commit comments