Skip to content

[Homepage] initial translation #6

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 10 commits into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/home/examples/a-component-using-external-plugins.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: A Component Using External Plugins
title: 使用外部程式的 Component
order: 3
domid: markdown-example
---

React allows you to interface with other libraries and frameworks. This example uses **remarkable**, an external Markdown library, to convert the `<textarea>`'s value in real time.
React component 可以靈活的運用其他的函式庫和框架。這個範例使用了 **remarkable**,一個外部的 Markdown 函式庫來即時處理 `<textarea>` 的內容。
6 changes: 3 additions & 3 deletions content/home/examples/a-simple-component.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: A Simple Component
title: 簡單的 Component
order: 0
domid: hello-example
---

React components implement a `render()` method that takes input data and returns what to display. This example uses an XML-like syntax called JSX. Input data that is passed into the component can be accessed by `render()` via `this.props`.
React component 需要實做 `render()` function,這個 function 接受輸入的資料並回傳需要顯示的內容。這個範例使用了 JSX,一個類似 XML 的語法。傳入給元件的輸入資料可以透過 `this.props` 在 `render()` function 中存取。

**JSX is optional and not required to use React.** Try the [Babel REPL](babel://es5-syntax-example) to see the raw JavaScript code produced by the JSX compilation step.
**使用 React 並不一定要使用 JSX。** 試試看 [Babel REPL](babel://es5-syntax-example) 來了解由 JSX 編譯步驟產生的原始 JavaScript 程式碼。
4 changes: 2 additions & 2 deletions content/home/examples/a-stateful-component.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: A Stateful Component
title: Stateful Component
order: 1
domid: timer-example
---

In addition to taking input data (accessed via `this.props`), a component can maintain internal state data (accessed via `this.state`). When a component's state data changes, the rendered markup will be updated by re-invoking `render()`.
除了接受輸入資料外(透過 `this.props` 存取),一個 Component 也可以保存自身的 state(透過 `this.state` 存取)。當一個 componentstate 改變的時候,產生的標記語法將會透過自動重新呼叫 `render()` 更新。
4 changes: 2 additions & 2 deletions content/home/examples/an-application.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: An Application
title: 一個應用程式
order: 2
domid: todos-example
---

Using `props` and `state`, we can put together a small Todo application. This example uses `state` to track the current list of items as well as the text that the user has entered. Although event handlers appear to be rendered inline, they will be collected and implemented using event delegation.
透過靈活運用 `props` `state`,我們可以寫一個很簡易的待辦事項的應用程式。這個範例使用 `state` 保存目前所有的待辦事項以及使用者目前輸入的文字。雖然這些 event handler 像是直接寫在程式碼中,實際上 React 內部會自動收集他們並透過 event delegation 實做。
6 changes: 3 additions & 3 deletions content/home/marketing/component-based.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Component-Based
title: 元件式開發
order: 1
---

Build encapsulated components that manage their own state, then compose them to make complex UIs.
首先實作一個擁有 state 的獨立 component,然後組合他們建立複雜的使用者介面。

Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
因為 component 的邏輯是用 JavaScript 寫的而不是使用其他樣板語言,你可以輕鬆的在你的程式中傳遞複雜的資料而不需將其藏在 DOM 之中。
6 changes: 3 additions & 3 deletions content/home/marketing/declarative.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Declarative
title: 宣告式
order: 0
---

React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.
React 讓實作互動式的使用者界面變得一點也不痛苦。你只要在你的應用程式中為每個情境設計一個簡單的 view,React 就會在資料變更時有效率的自動更新並 render 有異動的元件。

Declarative views make your code more predictable and easier to debug.
宣告式的 view 讓你更容易預測你的程式的行為,同時也較為容易除錯。
6 changes: 3 additions & 3 deletions content/home/marketing/learn-once-write-anywhere.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Learn Once, Write Anywhere
title: 學習一次,四處可通
order: 2
---

We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.
我們並不強制要求你使用特定的架構,所以你可以在 React 中開發新的功能而不需要重寫原有的程式碼。

React can also render on the server using Node and power mobile apps using [React Native](https://facebook.github.io/react-native/).
React 也可以透過 Node 在伺服器上預先執行,甚至也能透過 [React Native](https://facebook.github.io/react-native/) 使用在手機應用程式中。
20 changes: 10 additions & 10 deletions src/components/LayoutFooter/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
},
}}>
<FooterNav layoutHasSidebar={layoutHasSidebar}>
<MetaTitle onDark={true}>Docs</MetaTitle>
<MetaTitle onDark={true}>文件</MetaTitle>
{sectionListDocs.map(section => {
const defaultItem = section.items[0];
return (
Expand All @@ -73,7 +73,7 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
})}
</FooterNav>
<FooterNav layoutHasSidebar={layoutHasSidebar}>
<MetaTitle onDark={true}>Channels</MetaTitle>
<MetaTitle onDark={true}>溝通管道</MetaTitle>
<ExternalFooterLink
href="https://github.com/facebook/react"
target="_blank"
Expand All @@ -90,19 +90,19 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
href="https://discuss.reactjs.org"
target="_blank"
rel="noopener">
Discussion Forum
討論區
</ExternalFooterLink>
<ExternalFooterLink
href="https://discord.gg/0ZcbPKXt5bZjGY5n"
target="_blank"
rel="noopener">
Reactiflux Chat
Reactiflux 聊天室
</ExternalFooterLink>
<ExternalFooterLink
href="https://dev.to/t/react"
target="_blank"
rel="noopener">
DEV Community
DEV 社群
</ExternalFooterLink>
<ExternalFooterLink
href="https://www.facebook.com/react"
Expand All @@ -118,7 +118,7 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
</ExternalFooterLink>
</FooterNav>
<FooterNav layoutHasSidebar={layoutHasSidebar}>
<MetaTitle onDark={true}>Community</MetaTitle>
<MetaTitle onDark={true}>社群</MetaTitle>
{sectionListCommunity.map(section => (
<FooterLink
to={`/community/${section.items[0].id}.html`}
Expand All @@ -128,11 +128,11 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
))}
</FooterNav>
<FooterNav layoutHasSidebar={layoutHasSidebar}>
<MetaTitle onDark={true}>More</MetaTitle>
<FooterLink to="/tutorial/tutorial.html">Tutorial</FooterLink>
<MetaTitle onDark={true}>其他</MetaTitle>
<FooterLink to="/tutorial/tutorial.html">教學</FooterLink>
<FooterLink to="/blog/">Blog</FooterLink>
<FooterLink to="/acknowledgements.html">
Acknowledgements
致謝
</FooterLink>
<ExternalFooterLink
href="https://facebook.github.io/react-native/"
Expand Down Expand Up @@ -179,7 +179,7 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
color: colors.subtleOnDark,
paddingTop: 15,
}}>
{`Copyright © ${new Date().getFullYear()} Facebook Inc.`}
{`© ${new Date().getFullYear()} Facebook Inc 版權所有`}
</p>
</section>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/LayoutHeader/DocSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class DocSearch extends Component<{}, State> {
}}
id="algolia-doc-search"
type="search"
placeholder="Search docs"
aria-label="Search docs"
placeholder="文件搜尋"
aria-label="文件搜尋"
/>
</form>
) : null;
Expand Down
6 changes: 3 additions & 3 deletions src/components/LayoutHeader/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ const Header = ({location}: {location: Location}) => (
}}>
<HeaderLink
isActive={location.pathname.includes('/docs/')}
title="Docs"
title="文件"
to="/docs/getting-started.html"
/>
<HeaderLink
isActive={location.pathname.includes('/tutorial/')}
title="Tutorial"
title="教學"
to="/tutorial/tutorial.html"
/>
<HeaderLink
isActive={location.pathname.includes('/community/')}
title="Community"
title="社群"
to="/community/support.html"
/>
<HeaderLink
Expand Down
12 changes: 6 additions & 6 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Home extends Component {
return (
<Layout location={location}>
<TitleAndMetaTags
title="React &ndash; A JavaScript library for building user interfaces"
title="React &ndash; 用來實作使用者界面的 JavaScript 函式庫"
ogUrl={createOgUrl('index.html')}
/>
<div css={{width: '100%'}}>
Expand Down Expand Up @@ -134,7 +134,7 @@ class Home extends Component {
fontSize: 30,
},
}}>
A JavaScript library for building user interfaces
用來實作使用者界面的 JavaScript 函式庫
</p>
<Flex
valign="center"
Expand All @@ -149,12 +149,12 @@ class Home extends Component {
<ButtonLink
to="/docs/getting-started.html"
type="primary">
Get Started
了解更多
</ButtonLink>
</CtaItem>
<CtaItem>
<ButtonLink to="/tutorial/tutorial.html" type="secondary">
Take the Tutorial
入門教學
</ButtonLink>
</CtaItem>
</Flex>
Expand Down Expand Up @@ -286,12 +286,12 @@ class Home extends Component {
<Flex valign="center">
<CtaItem>
<ButtonLink to="/docs/getting-started.html" type="primary">
Get Started
了解更多
</ButtonLink>
</CtaItem>
<CtaItem>
<ButtonLink to="/tutorial/tutorial.html" type="secondary">
Take the Tutorial
入門學習
</ButtonLink>
</CtaItem>
</Flex>
Expand Down