|
| 1 | +# 现代 JavaScript 教程中文版 |
1 | 2 |
|
2 |
| -# JavaScript教程 |
| 3 | +这个仓库托管了现代 JavaScript 教程的中文版内容,发布于 [https://zh.javascript.info](https://zh.javascript.info)。 |
3 | 4 |
|
4 |
| -这个仓库托管现代 JavaScript 教程的内容,发布于 [https://javascript.info](https://javascript.info)。 |
| 5 | +## 赞助商 |
5 | 6 |
|
6 |
| -## 译文 |
| 7 | +<a href="https://coding.net/?utm_source=javascript-tutorial-zh&utm_medium=banner&utm_campaign=march2019" target="_blank"><img src="https://user-images.githubusercontent.com/26959437/56273145-c56aa000-612e-11e9-9137-a1388ef18cf2.png" width="300px;" target="_blank"/></a> |
7 | 8 |
|
8 |
| -已发布: |
9 |
| -- 俄语版:[https://github.com/iliakan/javascript-tutorial-ru](https://github.com/iliakan/javascript-tutorial-ru). |
| 9 | +## 翻译 |
10 | 10 |
|
11 |
| -进行中: |
12 |
| -- 中文版:在 [https://github.com/xitu/javascript-tutorial-zh](https://github.com/xitu/javascript-tutorial-zh) 进行翻译,如果你懂中文,欢迎加入。 |
13 |
| -- 西班牙语版:https://github.com/lmauromb/javascript-tutorial-es |
14 |
| -- 德语版:https://github.com/MartinEls/javascript-tutorial-de |
| 11 | +我们希望提供本教程的多语言版本。如果你感兴趣,那就快来和我们一起翻译吧。 |
15 | 12 |
|
16 |
| -如果你想将它翻译至你使用的语言的话,就 fork 英文版教程并开始你的翻译吧。我可以将它发布在域名 fr.javascript.info 下并署上你的名字,或由你发布在自己的域名下。 |
| 13 | +详见:https://javascript.info/translate |
17 | 14 |
|
18 |
| -你也可以对此文件发 PR 来表示工作正在进行中。 |
| 15 | +## 贡献 |
19 | 16 |
|
20 |
| -请注意,此教程可以用 <https://github.com/iliakan/javascript-tutorial-server/> 来达到本地运行的效果。 |
| 17 | +**That's how you can contribute:** |
21 | 18 |
|
22 |
| -## 赞助商 |
| 19 | +- See the [Chinese Translate Progress](https://github.com/javascript-tutorial/zh.javascript.info/issues/324) issue. |
| 20 | +- Choose an unchecked article you'd like to translate. |
| 21 | +- Add a comment with the article title to the issue, e.g. `An Introduction to JavaScript`. |
| 22 | + - Our bot will mark it in the issue, for everyone to know that you're translating it. |
| 23 | + - Your comment should contain only the title. |
| 24 | +- Fork the repository, translate and send a PR when done. |
| 25 | + - PR title should match article title, the bot will write it's number into the issue. |
23 | 26 |
|
24 |
| -<a href="https://coding.net/?utm_source=javascript-tutorial-zh&utm_medium=banner&utm_campaign=march2019" target="_blank"><img src="https://user-images.githubusercontent.com/26959437/56273145-c56aa000-612e-11e9-9137-a1388ef18cf2.png" width="300px;" target="_blank"/></a> |
| 27 | +Please kindly allow maintainers to review and merge or request changes in your translation. |
| 28 | + |
| 29 | +If maintainers do not respond, or if you'd like to become a maintainer, write us at the [main repo](https://github.com/javascript-tutorial/en.javascript.info/issues/new). |
| 30 | + |
| 31 | +**Let others know what you're translating, in message boards or chats in your language. Invite them to join!** |
| 32 | + |
| 33 | +🎉 Thank you! |
| 34 | + |
| 35 | +Your name and the contribution size will appear in the "About project" page when the translation gets published. |
| 36 | + |
| 37 | +P.S. The full list of languages can be found at <https://javascript.info/translate>. |
| 38 | + |
| 39 | +## Structure |
| 40 | + |
| 41 | +Every chapter, an article or a task resides in its own folder. |
| 42 | + |
| 43 | +The folder is named `N-url`, where `N` – is the number for sorting (articles are ordered), and `url` is the URL-slug on the site. |
| 44 | + |
| 45 | +The folder has one of files: |
| 46 | + |
| 47 | +- `index.md` for a section, |
| 48 | +- `article.md` for an article, |
| 49 | +- `task.md` for a task formulation (+`solution.md` with the solution text if any). |
| 50 | + |
| 51 | +A file starts with the `# Title Header`, and then the text in Markdown-like format, editable in a simple text editor. |
| 52 | + |
| 53 | +Additional resources and examples for the article or the task, are also in the same folder. |
| 54 | + |
| 55 | +## Translation Tips |
| 56 | + |
| 57 | +Please keep line breaks and paragraphs "as is": don't add newlines and don't remove existing ones. Makes it easy to merge future changes from the English version into the translation. |
| 58 | + |
| 59 | +If you see that the English version can be improved – great, please send a PR to it. |
| 60 | + |
| 61 | +### Terms |
| 62 | + |
| 63 | +- Some specification terms are not to be translated, e.g. "Function Declaration" can be left "as is". |
| 64 | +- For other terms like `resolved promise`, `slash`, `regexp`, and so on - look for a glossary, hopefully there's one for your language already. If not, look for translations in manuals, such as [MDN](https://developer.mozilla.org/en-US/). |
| 65 | + |
| 66 | +### Text in Code Blocks |
| 67 | + |
| 68 | +- Translate comments. |
| 69 | +- Translate user-messages and example strings. |
| 70 | +- Don't translate variables, classes, identifiers. |
| 71 | +- Ensure that the code works after the translation :) |
| 72 | + |
| 73 | +Example: |
| 74 | + |
| 75 | +```js |
| 76 | +// Example |
| 77 | +const text = "Hello, world"; |
| 78 | +document.querySelector('.hello').innerHTML = text; |
| 79 | +``` |
| 80 | + |
| 81 | +✅ DO (translate comment): |
| 82 | + |
| 83 | +```js |
| 84 | +// Ejemplo |
| 85 | +const text = 'Hola mundo'; |
| 86 | +document.querySelector('.hello').innerHTML = text; |
| 87 | +``` |
| 88 | + |
| 89 | +❌ DON'T (translate class): |
| 90 | + |
| 91 | +```js |
| 92 | +// Ejemplo |
| 93 | +const text = 'Hola mundo'; |
| 94 | +// ".hello" is a class |
| 95 | +// DO NOT TRANSLATE |
| 96 | +document.querySelector('.hola').innerHTML = text; |
| 97 | +``` |
| 98 | + |
| 99 | +### External Links |
| 100 | + |
| 101 | +If an external link is to Wikipedia, e.g. `https://en.wikipedia.org/wiki/JavaScript`, and a version of that article exists in your language that is of decent quality, link to that version instead. |
| 102 | + |
| 103 | +Example: |
| 104 | + |
| 105 | +```md |
| 106 | +[JavaScript](https://en.wikipedia.org/wiki/JavaScript) is a programming language. |
| 107 | +``` |
| 108 | + |
| 109 | +✅ OK (en -> es): |
| 110 | + |
| 111 | +```md |
| 112 | +[JavaScript](https://es.wikipedia.org/wiki/JavaScript) es un lenguaje de programación. |
| 113 | +``` |
| 114 | + |
| 115 | +For links to MDN, a partially translated version is ok. |
| 116 | + |
| 117 | +If a linked article has no translated version, leave the link "as is". |
| 118 | + |
| 119 | +### Metadata |
| 120 | + |
| 121 | +Some files, usually tasks, have YAML metadata at the top, delimited by `---`: |
| 122 | + |
| 123 | +```md |
| 124 | +importance: 5 |
| 125 | + |
| 126 | +--- |
| 127 | +... |
| 128 | +``` |
| 129 | + |
| 130 | +Please don't translate "importance" (and other top metadata). |
| 131 | + |
| 132 | +### Anchors |
| 133 | + |
| 134 | +Some headers have `[#anchor]` at the end, e.g. |
| 135 | + |
| 136 | +```md |
| 137 | +## Spread operator [#spread-operator] |
| 138 | +``` |
| 139 | + |
| 140 | +Please don't translate or remove the `[#...]` part, it's for URL anchors. |
25 | 141 |
|
26 |
| -## 结构 |
| 142 | +## Running locally |
27 | 143 |
|
28 |
| -每个章节、每篇文章或每个任务都有其文件夹。 |
| 144 | +You can run the tutorial server locally to see how the translation looks. |
29 | 145 |
|
30 |
| -文件夹都是以 `N-url` 的方式命名,`N` 是用于分类的数字,`url` 是包含材料标题的 URL。 |
| 146 | +The server and install instructions are at <https://github.com/javascript-tutorial/server>. |
31 | 147 |
|
32 |
| -材料的类型由文件夹内的文件来定义: |
| 148 | +我们希望与大家合作维护本教程。 |
33 | 149 |
|
34 |
| - - `index.md` 代表一个章节 |
35 |
| - - `article.md` 代表一篇文章 |
36 |
| - - `task.md` 代表一个任务(解答也一定会出现在 solution.md 文件中) |
| 150 | +本教程的贡献者列表详见:<https://zh.javascript.info/about>。 |
37 | 151 |
|
38 |
| -每个文件都从 `# Main header` 开始。 |
| 152 | +--- |
39 | 153 |
|
40 |
| -材料所需要的资源需要处于同一文件夹内。 |
| 154 | +💓 |
| 155 | +- Levi Ding [@leviding](https://github.com/leviding) |
| 156 | +- Ilya Kantor [@iliakan](https://github.com/iliakan) |
0 commit comments