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

update translation "your first component" & " importing and exporting components" #398

Closed
wants to merge 0 commits into from

Conversation

JamieLoLo
Copy link

Due to numerous conflicts with my previous version, I have forked the file again and executed it using the new file. I have pushed the updated version of "your first component" & " importing and exporting components". As mentioned in the previous review, I have presented all the import/export/root components using the original text format. Thank you.


In [Your First Component](/learn/your-first-component), you made a `Profile` component and a `Gallery` component that renders it:
在 [你的第一個 Component](/learn/your-first-component) 中,你建立了一個 `Profile` component,並且 render 在 `Gallery` component 裡:
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
[你的第一個 Component](/learn/your-first-component) 中,你建立了一個 `Profile` component,並且 render 在 `Gallery` component 裡:
[你的第一個 Component](/learn/your-first-component) 中,你建立了一個 `Profile` component,並且 render 在 `Gallery` component 裡:

* 什麼是 root component 檔案
* 如何 import / export 一個 component
* 何時使用預設和具名 import / export
* 如何從一個檔案 import / export 多個 component
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
* 如何從一個檔案 import / export 多個 component
* 如何從一個檔案 import export 多個 component

* How to split components into multiple files
* 什麼是 root component 檔案
* 如何 import / export 一個 component
* 何時使用預設和具名 import / export
Copy link
Member

Choose a reason for hiding this comment

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

reverse default and named keyword

Suggested change
* 何時使用預設和具名 import / export
* 何時使用 default 和 named import export

@@ -1,26 +1,26 @@
---
title: Importing and Exporting Components
title: Importing Exporting Component
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
title: Importing Exporting Component
title: Importing Exporting Component


## Exporting and importing a component {/*exporting-and-importing-a-component*/}
## Importing 與 Exporting 一個 component {/*exporting-and-importing-a-component*/}
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
## Importing 與 Exporting 一個 component {/*exporting-and-importing-a-component*/}
## Exporting 和 importing 一個 component {/*exporting-and-importing-a-component*/}


You may use either a default or a named export for `Profile`, but make sure that you use the corresponding import syntax in both `App.js` and `Gallery.js`! You can refer to the table from the deep dive above:
你可能會使用預設 export 或具名 export 的方式來 export `Profile`,但請確保在 `App.js` `Gallery.js` 中使用了相對應的 import 語法!具體方法可參考下方表格:
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
你可能會使用預設 export 或具名 export 的方式來 export `Profile`,但請確保在 `App.js``Gallery.js` 中使用了相對應的 import 語法!具體方法可參考下方表格:
你可能會使用 default export 或 named export 的方式來 export `Profile`,但請確保在 `App.js``Gallery.js` 中使用了相對應的 import 語法!具體方法可參考下方表格:

| ----------- | ----------- | ----------- |
| Default | `export default function Button() {}` | `import Button from './Button.js';` |
| Named | `export function Button() {}` | `import { Button } from './Button.js';` |
| 預設 | `export default function Button() {}` | `import Button from './Button.js';` |
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
| 預設 | `export default function Button() {}` | `import Button from './Button.js';` |
| Default | `export default function Button() {}` | `import Button from './Button.js';` |

| Default | `export default function Button() {}` | `import Button from './Button.js';` |
| Named | `export function Button() {}` | `import { Button } from './Button.js';` |
| 預設 | `export default function Button() {}` | `import Button from './Button.js';` |
| 具名 | `export function Button() {}` | `import { Button } from './Button.js';` |
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
| 具名 | `export function Button() {}` | `import { Button } from './Button.js';` |
| Named | `export function Button() {}` | `import { Button } from './Button.js';` |


<Solution>

This is the solution with named exports:
具名 export 的解決方法:
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
具名 export 的解決方法:
Named export 的解決方法:

@@ -367,7 +367,7 @@ img { margin: 0 10px 10px 0; height: 90px; }

</Sandpack>

This is the solution with default exports:
預設 export 的解決方法:
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
預設 export 的解決方法:
Default export 的解決方法:

@JamieLoLo JamieLoLo closed this Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants