Skip to content
(Work in progress) React documentation website in Simplified Chinese
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci no cache fallback Jul 11, 2018
.github
content
examples docs(cn): translate/content/docs/reference-react-component.md into Ch… Mar 20, 2019
flow-typed
gatsby
plugins fix: rm <script> Mar 7, 2019
scripts try again Feb 7, 2019
src finish translation for ErrorDecoder (#152) Mar 20, 2019
static
.babelrc
.eslintignore
.eslintrc
.flowconfig
.gitignore Bumped docs version Sep 6, 2018
.nvmrc point at 8.x.x release branch instead of exact 8.4 Jul 11, 2018
.prettierrc Moved Prettier config to config file Oct 5, 2017
CODE_OF_CONDUCT.md Added COC Oct 16, 2018
CONTRIBUTING.md Update CONTRIBUTING.md (#1234) Oct 7, 2018
LICENSE-DOCS.md
README.md
TRANSLATION.md
crowdin.yaml Updates CrowdIn configuration to use /lang/folder/file.md Nov 17, 2017
gatsby-browser.js
gatsby-config.js Update to zh-hans.reactjs.org Mar 10, 2019
gatsby-node.js
package.json Update to zh-hans.reactjs.org Mar 10, 2019
yarn.lock Update example project link (#1759) Feb 27, 2019

README.md

zh-hans.reactjs.org

This repo contains the source code and documentation powering reactjs.org.

关于中文翻译工作:

翻译流程:

  1. 挑选你想要翻译或校对的文章 New Chinese Website: TODOs
  2. 请 fork 这个仓库
  3. 基于 fork 后的仓库中 master 分支拉取一个新的分支(名字自取)
  4. 翻译(校对)你所选择的文章,提交到新的分支
  5. 此时提交 Pull Request 到该仓库
  6. 会有专人 Review 该 Pull Request,当两人以上通过该 Pull Request 时,你的翻译将被合并到仓库中
  7. 删除你所创建的分支(如继续参与,参考同步流程)

同步流程:

  1. 添加该 repo 为你 fork 后仓库上游

    $ git remote add upstream git@github.com:reactjs/zh-hans.reactjs.org.git
    or
    $ git remote add upstream https://github.com/reactjs/zh-hans.reactjs.org.git
    
  2. 同步 git fetch 上游代码

    $ git checkout master && git fetch upstream
    
  3. 将上游代码合并至你 fork 后的仓库(master 分支)中,保证你的 master 分支永远是最新版本

    $ git merge upstream/master
    
  4. 重复翻译流程

注意:

  1. 同步时不应产生 Merge 相关的 commit
  2. 尽量保证一次 PR 只有一篇文章,便于后续校对和维护

词汇表(Glossary):

大家在翻译过程中会遇到不需要翻译的内容,可以添加到词汇表中。

项目起步,部分内容逐步完善中。后续会添加相关流程图片,便于理解。 该流程我继续细化,如有疑问。

About Chinese translation:

Translation Process:

  1. Choose the article you want to translate or proofread New Chinese Website: TODOs
  2. Please fork this repo
  3. In the repo after fork, create a new branch (custom branch name) based on the master branch.
  4. Translation or proofread article, and commit your branch
  5. Commit your PR to this repo
  6. Please wait for Review.
  7. When PR merge to this repo, you can delete your branch.

Synchronization Process:

  1. Add the repo to become the remote upstream of your fork repo

    $ git remote add upstream git@github.com:reactjs/zh-hans.reactjs.org.git
    or
    $ git remote add upstream https://github.com/reactjs/zh-hans.reactjs.org.git
    
  2. Fetch remote upstream

    $ git fetch upstream
    
  3. Merge upstream/master to your repo/master

    $ git checkout master && git merge upstream/master
    
  4. Re-execute the translation process

Getting started

Prerequisites

  1. Git
  2. Node: any 8.x version starting with 8.4.0 or greater
  3. Yarn: See Yarn website for installation instructions
  4. A fork of the repo (for any contributions)
  5. A clone of the reactjs.org repo on your local machine

Installation

  1. cd reactjs.org to go into the project root
  2. yarn to install the website's npm dependencies

Running locally

  1. yarn dev to start the hot-reloading development server (powered by Gatsby)
  2. open http://localhost:8000 to open the site in your favorite browser

Contributing

Guidelines

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.

Create a branch

  1. git checkout master from any folder in your local reactjs.org repository
  2. git pull origin master to ensure you have the latest main code
  3. git checkout -b the-name-of-my-branch (replacing the-name-of-my-branch with a suitable name) to create a branch

Make the change

  1. Follow the "Running locally" instructions
  2. Save the files and check in the browser
  3. Changes to React components in src will hot-reload
  4. Changes to markdown files in content will hot-reload
  5. If working with plugins, you may need to remove the .cache directory and restart the server

Test the change

  1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
  2. Run yarn check-all from the project root. (This will run Prettier, ESLint, and Flow.)

Push it

  1. git add -A && git commit -m "My message" (replacing My message with a commit message, such as Fixed header logo on Android) to stage and commit your changes
  2. git push my-fork-name the-name-of-my-branch
  3. Go to the reactjs.org repo and you should see recently pushed branches.
  4. Follow GitHub's instructions.
  5. If possible, include screenshots of visual changes. A Netlify build will also be automatically created once you make your PR so other people can see your change.

Translation

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.

Troubleshooting

  • yarn reset to clear the local cache

License

Content submitted to reactjs.org is CC-BY-4.0 licensed, as found in the LICENSE-DOCS.md file.

You can’t perform that action at this time.