React documentation website in Simplified Chinese
此仓库包含 React 中文文档 的文档及源码,并由官方实时同步。
翻译基本接近尾声,但文档中也有可能存在疏漏之处。
如在阅读文档中,遇到文档的问题可直接 PR 修改。
也可添加反馈群。我们会及时给出反馈。
当然也可以在群里交流 React 相关的交流心得,非常欢迎。
希望大家共同把这个文档维护好,造福更多 React 开发者。
翻译流程:
同步流程:
添加该 repo 为你 fork 后仓库上游
$ git remote add upstream [email protected]:reactjs/zh-hans.reactjs.org.git or $ git remote add upstream https://github.com/reactjs/zh-hans.reactjs.org.git
同步 git fetch 上游代码
$ git checkout master && git fetch upstream
将上游代码合并至你 fork 后的仓库(master 分支)中,保证你的 master 分支永远是最新版本
$ git merge upstream/master
重复翻译流程
注意:
- 同步时不应产生 Merge 相关的 commit
- 尽量保证一次 PR 只有一篇文章,便于后续校对和维护
词汇表(Glossary):
大家在翻译过程中会遇到不需要翻译的内容,可以添加到词汇表中。
项目起步,部分内容逐步完善中。后续会添加相关流程图片,便于理解。 该流程我继续细化,如有疑问。
Translation Process:
Synchronization Process:
Add the repo to become the remote upstream of your fork repo
$ git remote add upstream [email protected]:reactjs/zh-hans.reactjs.org.git or $ git remote add upstream https://github.com/reactjs/zh-hans.reactjs.org.git
Fetch remote upstream
$ git fetch upstream
Merge upstream/master to your repo/master
$ git checkout master && git merge upstream/master
Re-execute the translation process
cd reactjs.orgto go into the project root
yarnto install the website's npm dependencies
yarn devto start the hot-reloading development server (powered by Gatsby)
open http://localhost:8000to open the site in your favorite browser
The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the contributing guidelines for the appropriate sections.
git checkout masterfrom any folder in your local
reactjs.orgrepository
git pull origin masterto ensure you have the latest main code
git checkout -b the-name-of-my-branch(replacing
the-name-of-my-branchwith a suitable name) to create a branch
srcwill hot-reload
contentwill hot-reload
.cachedirectory and restart the server
yarn check-allfrom the project root. (This will run Prettier, ESLint, and Flow.)
git add -A && git commit -m "My message"(replacing
My messagewith a commit message, such as
Fix header logo on Android) to stage and commit your changes
git push my-fork-name the-name-of-my-branch
If you are interested in translating
reactjs.org, please see the current translation efforts at isreacttranslatedyet.com.
If your language does not have a translation and you would like to create one, please follow the instructions at reactjs.org Translations.
yarn resetto clear the local cache
Content submitted to reactjs.org is CC-BY-4.0 licensed, as found in the LICENSE-DOCS.md file.