Skip to content

doc: translate strict mode to zh-hant #105

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

Merged
merged 4 commits into from
Nov 11, 2019

Conversation

eyeccc
Copy link
Contributor

@eyeccc eyeccc commented Oct 26, 2019

doc: translate strict mode to zh-hant

@netlify
Copy link

netlify bot commented Oct 26, 2019

Deploy preview for zh-hant-reactjs-org ready!

Built with commit d18116b

https://deploy-preview-105--zh-hant-reactjs-org.netlify.com

@neighborhood999 neighborhood999 self-requested a review November 7, 2019 14:13
@neighborhood999 neighborhood999 added In Review Currently under review and removed Review Needed labels Nov 7, 2019
permalink: docs/strict-mode.html
---

`StrictMode` is a tool for highlighting potential problems in an application. Like `Fragment`, `StrictMode` does not render any visible UI. It activates additional checks and warnings for its descendants.
`嚴格模式(Strict Mode)` 是一個用來突顯應用程式裡潛在問題的工具。如同 `Fragment` 一樣,`嚴格模式`不會 render 任何可見的 UI。它為了它底下的所有子元件們啟動了額外的檢查和警告。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`嚴格模式(Strict Mode)` 是一個用來突顯應用程式裡潛在問題的工具。如同 `Fragment` 一樣,`嚴格模式`不會 render 任何可見的 UI。它為了它底下的所有子元件們啟動了額外的檢查和警告
`嚴格模式`是一個用來突顯應用程式裡潛在問題的工具。如同 `Fragment` 一樣,`嚴格模式`不會 render 任何可見的 UI。它為了底下的所有的依賴們啟動了額外的檢查和警告

>
> Strict mode checks are run in development mode only; _they do not impact the production build_.
> 嚴格模式檢查只會在開發模式中執行;_它們不應該影響線上的應用程式_。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> 嚴格模式檢查只會在開發模式中執行;_它們不應該影響線上的應用程式_
> 嚴格模式檢查只會在開發模式中執行;_它們不應該影響正式環境_


In the above example, strict mode checks will *not* be run against the `Header` and `Footer` components. However, `ComponentOne` and `ComponentTwo`, as well as all of their descendants, will have the checks.
在上面的例子裡,嚴格模式檢查將*不會*跑在 `Header` `Footer` 元件上。然而 `ComponentOne` `ComponentTwo`,以及它們底下的所有子元件,都會被檢查。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
在上面的例子裡,嚴格模式檢查將*不會*跑在 `Header``Footer` 元件上。然而 `ComponentOne``ComponentTwo`以及它們底下的所有子元件,都會被檢查。
在上面的範例裡,嚴格模式檢查將*不會*跑在 `Header``Footer` 元件上。然而 `ComponentOne``ComponentTwo`以及它們底下的所有子依賴,都會被檢查。

* [Warning about deprecated findDOMNode usage](#warning-about-deprecated-finddomnode-usage)
* [Detecting unexpected side effects](#detecting-unexpected-side-effects)
* [Detecting legacy context API](#detecting-legacy-context-api)
`嚴格模式` 目前幫助了:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`嚴格模式` 目前幫助了
`嚴格模式`目前可以幫助

* [Detecting legacy context API](#detecting-legacy-context-api)
`嚴格模式` 目前幫助了:
* [發現擁有不安全生命週期的 component](#identifying-unsafe-lifecycles)
* [警告使用到了既有的 string ref API](#warning-about-legacy-string-ref-api-usage)
Copy link
Member

Choose a reason for hiding this comment

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

I prefer:

Suggested change
* [警告使用到了既有的 string ref API](#warning-about-legacy-string-ref-api-usage)
* [警告使用了 legacy string ref API](#warning-about-legacy-string-ref-api-usage)


Strict mode can't automatically detect side effects for you, but it can help you spot them by making them a little more deterministic. This is done by intentionally double-invoking the following methods:
嚴格模式無法自動偵測副作用,但它可以藉由使這些副作用變得更有確定性,來幫助你發現它們。它藉由故意調用兩次下面的函式來完成這個功能:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
嚴格模式無法自動偵測副作用,但它可以藉由使這些副作用變得更有確定性,來幫助你發現它們。它藉由故意調用兩次下面的函式來完成這個功能:
嚴格模式無法自動檢測 side effect,但它可以藉由使這些 side effect 變得更有確定性,來幫助你發現它們。它藉由故意調用兩次下面的函式來完成這個功能:

>
> This only applies to development mode. _Lifecycles will not be double-invoked in production mode._
> 這個只在開發模式發生。 _生命週期不會被重複調用在線上模式。_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> 這個只在開發模式發生。 _生命週期不會被重複調用在線上模式_
> 這個只在開發模式發生。_生命週期不會被重複調用在正式環境_


### Detecting legacy context API {#detecting-legacy-context-api}
### 偵測既有的 context API {#detecting-legacy-context-api}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### 偵測既有的 context API {#detecting-legacy-context-api}
### 檢測 legacy context API {#detecting-legacy-context-api}


The legacy context API is error-prone, and will be removed in a future major version. It still works for all 16.x releases but will show this warning message in strict mode:
既有的 context API 是容易出錯的,並將在以後的主要版本中刪除。它仍然適用於所有 16.x 版本,但將在嚴格模式下顯示以下警告訊息:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
既有的 context API 是容易出錯的,並將在以後的主要版本中刪除。它仍然適用於所有 16.x 版本,但將在嚴格模式下顯示以下警告訊息:
Legacy context API 是容易出錯的,並將在以後的主要版本中刪除。它仍然適用於所有 16.x 版本,但將在嚴格模式下顯示以下警告訊息:


![](../images/blog/warn-legacy-context-in-strict-mode.png)

Read the [new context API documentation](/docs/context.html) to help migrate to the new version.
閱讀[新的 context API文檔](/docs/context.html),以幫助遷移到新版本。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
閱讀[新的 context API文檔](/docs/context.html)以幫助遷移到新版本
閱讀[新的 context API 文件](/docs/context.html)以助於遷移到新版本

Copy link
Member

@neighborhood999 neighborhood999 left a comment

Choose a reason for hiding this comment

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

Thank you for helping translation.

@neighborhood999 neighborhood999 added Revision Needed and removed In Review Currently under review labels Nov 8, 2019
@eyeccc
Copy link
Contributor Author

eyeccc commented Nov 11, 2019

@neighborhood999 Just updated based on suggestion. Thanks

Copy link
Member

@neighborhood999 neighborhood999 left a comment

Choose a reason for hiding this comment

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

Thank you @eyeccc!

@neighborhood999 neighborhood999 merged commit a3f7ee5 into reactjs:master Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants