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

docs: JSX in Depth #102

Merged
merged 4 commits into from
Nov 1, 2019
Merged

docs: JSX in Depth #102

merged 4 commits into from
Nov 1, 2019

Conversation

aboudicheng
Copy link
Contributor

Please let me know if you have any suggestion and if any revision can be made.

@netlify
Copy link

netlify bot commented Oct 21, 2019

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

Built with commit a9cd027

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

Co-Authored-By: Peng Jie <dean.leehom@gmail.com>
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.

Hi @aboudicheng

Thank you for your helping translation, I left some suggestions below, if have any suggestion, feel free left some comments.

content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
content/docs/jsx-in-depth.md Outdated Show resolved Hide resolved
@aboudicheng
Copy link
Contributor Author

Thank you @neighborhood999 for the suggestions. Please check again and see if anything else could be revised.

@@ -31,13 +31,13 @@ React.createElement(
)
```

You can also use the self-closing form of the tag if there are no children. So:
如果沒有 children 的話你也可以使用自我閉合的標籤形式。如:
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
如果沒有 children 的話你也可以使用自我閉合的標籤形式。如
如果沒有 children 的話你也可以使用閉合的標籤形式。例如

@@ -71,11 +71,11 @@ function WarningButton() {
}
```

If you don't use a JavaScript bundler and loaded React from a `<script>` tag, it is already in scope as the `React` global.
如果你不使用任何 JavaScript bundler 並以 `<script>` 標籤來導入 React,那麼它就已經以 `React` 存在於作用域中了。
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
如果你不使用任何 JavaScript bundler 並以 `<script>` 標籤來導入 React,那麼它就已經以 `React` 存在於作用域中了。
如果你不使用任何 JavaScript bundler 並從 `<script>` 標籤來載入 React,那麼它就已經以 `React` 存在於作用域中了。


### Using Dot Notation for JSX Type {#using-dot-notation-for-jsx-type}
### 在 JSX 類型中使用 Dot Notation {#using-dot-notation-for-jsx-type}
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
### 在 JSX 類型中使用 Dot Notation {#using-dot-notation-for-jsx-type}
### 在 JSX 類型中使用點記法 {#using-dot-notation-for-jsx-type}

reference: https://developer.mozilla.org/zh-TW/docs/Learn/JavaScript/Objects/Basics


You can also refer to a React component using dot-notation from within JSX. This is convenient if you have a single module that exports many React components. For example, if `MyComponents.DatePicker` is a component, you can use it directly from JSX with:
你也可以在 JSX 中使用 dot-notation 來指向一個 React Component。這對當你有一個會導出許多 React component 的 module 來講是十分方便的。舉例來說,如果 `MyComponents.DatePicker` 是一個 component,那麼你可以在 JSX 中直接這樣使用:
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member

@bugtender bugtender 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 @aboudicheng ~

@@ -452,7 +452,7 @@ To fix this, make sure that the expression before `&&` is always boolean:
</div>
```

Conversely, if you want a value like `false`, `true`, `null`, or `undefined` to appear in the output, you have to [convert it to a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#String_conversion) first:
相反地,如果你想要印出 `false``true``null` 或者 `undefined` 時,你必須要先把它[轉換成一個 string](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/String#String_conversion)
Copy link
Member

Choose a reason for hiding this comment

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

Should we translate this string to 字串 here?
I think it's just a 字串, not a special word we need to keep in English 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neighborhood999 suggested that string literals can be translated as 字串字面值, so I suppose there's no big deal in translating string to 字串. Thanks for pointing out.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. That makes sense. Thank you!

@aboudicheng
Copy link
Contributor Author

Updated according to the suggestions, please check again.

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 @aboudicheng!

@neighborhood999 neighborhood999 merged commit f23c26c into reactjs:master Nov 1, 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.

None yet

3 participants