Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add README in Chinese #5046

Merged
merged 9 commits into from
Jan 3, 2019
Merged

add README in Chinese #5046

merged 9 commits into from
Jan 3, 2019

Conversation

raoenhui
Copy link
Contributor

add README in Chinese

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the translation! It's great to see the Chinese README 👍

However it seems that it's not finished yet? (as I commented and also in FAQ and some other sections)

Also, some terms such as "NPM", "JS" and "CSS" should not be "npm", "js" and "css". And the spaces between Chinese words and alphabets are kind of confused. i.e. 而不依靠 Node.js服务。 there's a whitespace before Node.js (which is very nice!) but we should also add a whitespace after it ;) It improves the readability of Chinese tech docs.

Minor thing: I think the file name (readme-cn.md) would be better as uppercase and use "zh-CN" (README-zh-CN.md) to follow README.md.

readme-cn.md Outdated
[![Coverage Status](https://coveralls.io/repos/zeit/next.js/badge.svg?branch=master)](https://coveralls.io/r/zeit/next.js?branch=master)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/next-js)

Next.js 是一个轻巧的React服务端渲染应用框架。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“轻量级” would be more commonly used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have modified it.

readme-cn.md Outdated

当页面初始化加载时,`getInitialProps`只会加载在服务端。只有当路由跳转(`Link`组件跳转或API方法跳转)时,客户端才会执行`getInitialProps`。

_Note: `getInitialProps` can **not** be used in children components. Only in `pages`._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing translation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have translated it.

readme-cn.md Outdated

只有第二个`<meta name="viewport" />`才被渲染。

注意:在卸载组件时,' <head> '的内容将被清除。请确保每个页面都在其`<head>`定义了所需要的内容,而不是假设其他页面已经加过了
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the spaces in ` <head> ` :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have removed it.

readme-cn.md Outdated

<br/>

你也可以给5⃣无状态组件定义 `getInitialProps`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5⃣ 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have removed it.

readme-cn.md Outdated
2. If it defines `getInitialProps`, data is fetched. If an error occurs, `_error.js` is rendered2.
2. 如果组件定义了`getInitialProps`,数据获取了。如果有错误情况将会渲染 `_error.js`。
3. After 1 and 2 complete, `pushState` is performed and the new component is rendered
3. 1和2都完成了,`pushState`执行,新组件被渲染。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing translation for 2 & 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have translated it.

readme-cn.md Outdated
}
```

这个只是在开发环境才有的功能。如果你在生成环境中想缓存SSR页面,请查看[SSR-caching](https://github.com/zeit/next.js/tree/canary/examples/ssr-caching
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a ) at the end of the URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have fixed it.

readme-cn.md Outdated
opts的属性如下:
- `dev` (`boolean`) 判断 Next.js应用是否在开发环境 - 默认 `false`
- `dir` (`string`) Next项目路径 - 默认 `'.'`
- `quiet` (`boolean`) Hide error messages containing server information - 默认 `false`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not translated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have translated it.

readme-cn.md Outdated
<a id="configuring-the-build-id" style="display: none"></a>
#### 配置构建ID

Next.js使用一个常量来判断你的应用服务是哪个版本。因为多个服务部署应用,那`next build`命令将会在多个服务器中运行,为了保持同一个构建ID,可以配置`generateBuildId`函数:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为多个服务部署应用,那 next build 命令将会在多个服务器中运行 was wrongly translated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion,I re-translated it like "Next.js使用构建时生成的常量来标识你的应用服务是哪个版本。在每台服务器上运行构建命令时,可能会导致多服务器部署出现问题。为了保持同一个构建ID,可以配置generateBuildId函数:"

readme-cn.md Outdated

为了扩展方便我们使用`babel`,可以在应用根目录新建`.babelrc`文件,该文件可配置。

如果有该文件,我们将会考虑来源的真实性,因此同样你需要定义next,也就是 `next/babel`预设。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“source of truth” should be “数据源”, not “来源的真实性”.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have modified it.

readme-cn.md Outdated
## 问答

<details>
<summary>这个产品准备好了吗?</summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Production ready: “可以用于生产环境吗?”.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have modified it.

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @raoenhui 🙏 it looks perfect!
@timneutkens can we merge this PR and add a link in README.md?

@rauchg
Copy link
Member

rauchg commented Jan 3, 2019

@timneutkens I'm +1 on merging this, and then we can port it to nextjs.org once we implement i18n there.

@timneutkens
Copy link
Member

Okay let's ship it then 👍

@timneutkens timneutkens merged commit f40ed30 into vercel:canary Jan 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants