|
1 |
| -# Flask 中文文档 |
| 1 | +# The Chinese Translation of Flask's Documentation |
2 | 2 |
|
3 | 3 | 这里是 Flask 文档中文翻译项目,欢迎参与!
|
4 | 4 |
|
5 |
| -1. 在开始翻译之前,请务必阅读下面的 Contributing Guide 了解翻译流程,然后阅读[这个 issue](https://github.com/greyli/flask-docs-zh/issues/11) 了解翻译要求,并在[这些 discussions](https://github.com/greyli/flask-docs-zh/discussions/categories/vote) 中分别投票选出最佳翻译词汇、中文 logo 字体和中文标语。 |
6 |
| -2. 需要强调的是,完成一章的翻译要提交两个 PR:第一个 PR 在对应的章节条目后添加自己的用户名以认领章节;第二个 PR 翻译对应的 `.po` 文件并勾选完成的章节条目。先认领,再翻译,一次只认领一章。 |
7 |
| -3. 不要改动任何 ReStructuredText 标记、变量/类/函数/方法名称、URL 等。 |
| 5 | +参与前请完成以下任务: |
8 | 6 |
|
9 |
| -如果有其他问题和相关想法,请[创建 discussion](https://github.com/greyli/flask-docs-zh/discussions/new) 发起讨论;如果对翻译流程和项目设置有改进建议,或是发现了翻译错误和笔误,请[创建 issue](https://github.com/greyli/flask-docs-zh/issues/new) 反馈。 |
10 |
| - |
11 |
| -这个项目在后期会转移到 [FlaskCWG](https://github.com/flaskcwg) 组织,并在翻译完成后链接到 Flask 官方文档。 |
12 |
| - |
13 |
| - |
14 |
| -## Contributing Guide |
15 |
| - |
16 |
| - |
17 |
| -### Installation |
18 |
| - |
19 |
| -- Click the "Fork" button to fork this repository on GitHub. |
20 |
| -- Clone your fork repository locally (replace `{username}` with your username): |
21 |
| - |
22 |
| -``` |
23 |
| -$ git clone https://github.com/{username}/flask-docs-zh |
24 |
| -$ cd flask-docs-zh |
25 |
| -$ git remote add upstream https://github.com/greyli/flask-docs-zh |
26 |
| -``` |
27 |
| - |
28 |
| -- Create a virtual environment and install requirements: |
29 |
| - |
30 |
| -For Linux/macOS: |
31 |
| - |
32 |
| -``` |
33 |
| -$ python3 -m venv env |
34 |
| -$ source env/bin/activate |
35 |
| -$ python -m pip install --upgrade pip setuptools |
36 |
| -$ pip install -r requirements/dev.txt |
37 |
| -$ pip install -e . |
38 |
| -$ pre-commit install |
39 |
| -``` |
40 |
| - |
41 |
| -For Windows: |
42 |
| - |
43 |
| -``` |
44 |
| -> python -m venv env |
45 |
| -> env\Scripts\activate |
46 |
| -> python -m pip install --upgrade pip setuptools |
47 |
| -> pip install -r .\requirements\dev.txt |
48 |
| -> pip install -e . |
49 |
| -> pre-commit install |
50 |
| -``` |
51 |
| - |
52 |
| - |
53 |
| -### Self-Assignment |
54 |
| - |
55 |
| -- Open your fork repository on GitHub. |
56 |
| -- Click the "Fetch upstream" button to update your fork. |
57 |
| -- Click the edit button (a pencil icon in the upper right corner of the README) |
58 |
| -to edit the README. |
59 |
| -- Find the "Translation To-do List" section, mark the chapter you want to |
60 |
| -translate in following format: |
61 |
| - |
62 |
| -``` |
63 |
| -- [ ] example @your_username Your Name |
64 |
| -``` |
65 |
| - |
66 |
| -You can link the username to your GitHub profile: |
67 |
| - |
68 |
| -``` |
69 |
| -- [ ] example [@your_username](https://github.com/your_username) Your Name |
70 |
| -``` |
71 |
| - |
72 |
| -- Leave a commit message (e.g., "Assign example to @your_username"), then select |
73 |
| -"Create a new branch for this commit and start a pull request" and click the |
74 |
| -"Commit changes" button to create a PR. |
| 7 | +1. 阅读《[贡献指南](https://github.com/greyli/flask-docs-zh/blob/main/CONTRIBUTING.md)》了解翻译贡献流程。 |
| 8 | +2. 阅读《[翻译要求与建议](https://github.com/greyli/flask-docs-zh/issues/11)》了解翻译要求。 |
| 9 | +3. 在[这些讨论](https://github.com/greyli/flask-docs-zh/discussions/categories/vote)中分别投票选出你喜欢的中文 logo 字体、中文标语翻译和词汇翻译。 |
75 | 10 |
|
| 11 | +**需要强调的是,完成一章的翻译要提交两个 PR:第一个 PR 在对应的章节条目后添加自己的用户名以认领章节([示例 PR](https://github.com/greyli/flask-docs-zh/pull/20/files));第二个 PR 翻译对应的 `.po` 文件并勾选完成的章节条目([示例 PR](https://github.com/greyli/flask-docs-zh/pull/43/files))。先认领,再翻译,一次只认领一章。** |
76 | 12 |
|
77 |
| -### Translation |
78 |
| - |
79 |
| -- When the self-assignment PR is merged, create a new branch locally |
80 |
| -(be sure to update the example branch name, for example, `translate-cli`): |
81 |
| - |
82 |
| -``` |
83 |
| -$ git fetch upstream |
84 |
| -$ git checkout -b your-branch-name upstream/main |
85 |
| -``` |
86 |
| - |
87 |
| -- Translate the `.po` file in the `docs/locales/zh_CN/LC_MESSAGES` directory. |
88 |
| - |
89 |
| -An example of one such file, from docs/.../index.po, is given below. |
90 |
| - |
91 |
| -```po |
92 |
| -#: ../../index.rst:4 |
93 |
| -msgid "Welcome to Flask" |
94 |
| -msgstr "欢迎来到 Flask 的世界" |
95 |
| -``` |
96 |
| - |
97 |
| -Another case, msgid is multi-line text and contains reStructuredText syntax: |
98 |
| - |
99 |
| -```po |
100 |
| -#: ../../index.rst:11 |
101 |
| -msgid "" |
102 |
| -"Welcome to Flask's documentation. Get started with :doc:`installation` " |
103 |
| -"and then get an overview with the :doc:`quickstart`." |
104 |
| -msgstr "" |
105 |
| -"欢迎来到 Flask 的文档。你可以从 :doc:`installation` 入手" |
106 |
| -"然后阅读 :doc:`quickstart` 来了解基本概念。" |
107 |
| -``` |
108 |
| - |
109 |
| -Please be careful not to break reST notation. Most |
110 |
| -[po-editors](https://www.gnu.org/software/trans-coord/manual/web-trans/html_node/PO-Editors.html) will help you with that. |
111 |
| - |
112 |
| -- Mark the chapter as finished (fill the checkbox with "x"): |
113 |
| - |
114 |
| -``` |
115 |
| -- [x] example @your_username Your Name |
116 |
| -``` |
117 |
| - |
118 |
| -- Update the `Last-Translator` field at the top of the `.po` file. |
119 |
| -- Commit the changes: |
120 |
| - |
121 |
| -``` |
122 |
| -$ git add docs/locales/zh_CN/LC_MESSAGES/example.po README.md |
123 |
| -$ git commit -m "Translate docs/example" |
124 |
| -``` |
125 |
| - |
126 |
| -- Build the docs and preview the changes: |
127 |
| - |
128 |
| -For Linux/macOS: |
129 |
| - |
130 |
| -``` |
131 |
| -$ cd docs |
132 |
| -$ make html |
133 |
| -``` |
134 |
| - |
135 |
| -For Windows: |
136 |
| - |
137 |
| -``` |
138 |
| -> cd docs |
139 |
| -> .\make.bat html |
140 |
| -``` |
141 |
| - |
142 |
| -Open `{project_location}/docs/_build/html/index.html` in your browser to view the docs. |
| 13 | +如果有其他问题和相关想法,请[创建 discussion](https://github.com/greyli/flask-docs-zh/discussions/new) 发起讨论;如果对翻译流程和项目设置有改进建议,或是发现了翻译错误和笔误,请[创建 issue](https://github.com/greyli/flask-docs-zh/issues/new) 反馈。 |
143 | 14 |
|
144 |
| -- If everything is working as expected, push the changes to GitHub: |
| 15 | +这个项目在后期会转移到 [FlaskCWG](https://github.com/flaskcwg) 组织,并在翻译完成后链接到 Flask 官方文档。 |
145 | 16 |
|
146 |
| -``` |
147 |
| -$ git push origin your-branch-name |
148 |
| -``` |
149 | 17 |
|
150 |
| -- Open the home page of your forked repository, you will see a notice about |
151 |
| -the new branch. Click the "Compare & pull request" button to create a PR. |
152 |
| -- The translation coordinator will review your PR very soon. Thank you! |
| 18 | +## Reviewers |
153 | 19 |
|
| 20 | +- Grey Li ([@greyli](https://github.com/greyli)) |
| 21 | +- Frost Ming ([@frostming](https://github.com/frostming)) |
154 | 22 |
|
155 |
| -## Translation To-do List |
156 | 23 |
|
157 |
| -Be sure only mark one chapter at a time, mark another one when the former |
158 |
| -PR is created. Unless it's a long chapter, we may reset the assignment |
159 |
| -if you doesn't finish the translation in ten days. |
| 24 | +## Translators (Translation To-do List) |
160 | 25 |
|
161 | 26 |
|
162 | 27 | ### docs/
|
|
0 commit comments