Skip to content

Commit 37ea16e

Browse files
authored
Merge pull request react-navigation#145 from shixiaoquan/source
Add Chinese translation for the some pages
2 parents 708682b + 6bf757f commit 37ea16e

File tree

4 files changed

+61
-41
lines changed

4 files changed

+61
-41
lines changed

website/core/Footer.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,48 +25,53 @@ class Footer extends React.Component {
2525
<h5>Docs</h5>
2626
<a
2727
href={
28-
this.props.config.baseUrl +
29-
'docs/getting-started.html'
28+
`${this.props.config.baseUrl}docs/${this.props.language}/getting-started.html`
3029
}>
3130
Getting Started
3231
</a>
3332
<a
3433
href={
35-
this.props.config.baseUrl +
36-
'docs/api-reference.html'
34+
`${this.props.config.baseUrl}docs/${this.props.language}/api-reference.html`
3735
}>
3836
API Reference
3937
</a>
4038
<a
4139
href={
42-
this.props.config.baseUrl +
43-
'docs/custom-navigator-overview.html'
40+
`${this.props.config.baseUrl}docs/${this.props.language}/custom-navigator-overview.html`
4441
}>
4542
Building your own Navigator
4643
</a>
4744
<a
4845
href={
49-
this.props.config.baseUrl +
50-
'docs/contributing.html'
46+
`${this.props.config.baseUrl}docs/${this.props.language}/contributing.html`
5147
}>
5248
Contributing
5349
</a>
5450
</div>
5551
<div>
5652
<h5>Support</h5>
57-
<a href="https://discord.gg/4xEK3nD">Chat in our Discord channel</a>
58-
<a href="https://react-navigation.canny.io/feature-requests">Request a feature on Canny</a>
59-
<a href="https://github.com/react-navigation/react-navigation/issues">Report a bug on Github</a>
53+
<a href="https://discord.gg/4xEK3nD">
54+
Chat in our Discord channel
55+
</a>
56+
<a href="https://react-navigation.canny.io/feature-requests">
57+
Request a feature on Canny
58+
</a>
59+
<a href="https://github.com/react-navigation/react-navigation/issues">
60+
Report a bug on Github
61+
</a>
6062
<a
6163
href="https://stackoverflow.com/questions/tagged/react-navigation"
62-
target="_blank">
64+
target="_blank"
65+
>
6366
Get help on Stack Overflow
6467
</a>
6568
</div>
6669
<div>
6770
<h5>More</h5>
6871
{/* <a href={this.props.config.baseUrl + 'blog'}>Blog</a> */}
69-
<a href={this.props.config.repoUrl}>GitHub</a>
72+
<a href={this.props.config.repoUrl}>
73+
GitHub
74+
</a>
7075
<a
7176
className="github-button"
7277
href={this.props.config.repoUrl}

website/languages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const languages = [
172172
tag: 'vi',
173173
},
174174
{
175-
enabled: false,
175+
enabled: true,
176176
name: '中文',
177177
tag: 'zh-Hans',
178178
},

website/pages/en/help.js

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
const React = require('react');
99

10+
const translate = require("../../server/translate.js").translate;
1011
const CompLibrary = require('../../core/CompLibrary.js');
1112
const Container = CompLibrary.Container;
1213
const GridBlock = CompLibrary.GridBlock;
@@ -18,17 +19,17 @@ class Help extends React.Component {
1819
const supportLinks = [
1920
{
2021
content:
21-
'Learn more using the [documentation on this site.](/docs/getting-started.html) and [reading the API reference](/content/docs/api-reference.html).',
22-
title: 'Browse Docs and API',
22+
<translate>Learn more using the [documentation on this site.](/docs/getting-started.html) and [reading the API reference](/content/docs/api-reference.html).</translate>,
23+
title: <translate>Browse Docs and API</translate>,
2324
},
2425
{
25-
content: 'Ask questions about the documentation and project in the `#react-navigation` channel on the [Reactiflux Discord](https://discord.gg/4xEK3nD).',
26-
title: 'Join the community',
26+
content: <translate>Ask questions about the documentation and project in the `#react-navigation` channel on the [Reactiflux Discord](https://discord.gg/4xEK3nD).</translate>,
27+
title: <translate>Join the community</translate>,
2728
},
2829
{
2930
content:
30-
'Read the release notes for new versions of React Navigation in the [releases tab on the Github repository](https://github.com/react-navigation/react-navigation/releases).',
31-
title: 'Stay up to date',
31+
<translate>Read the release notes for new versions of React Navigation in the [releases tab on the Github repository](https://github.com/react-navigation/react-navigation/releases).</translate>,
32+
title: <translate>Stay up to date</translate>,
3233
},
3334
];
3435

@@ -37,18 +38,31 @@ class Help extends React.Component {
3738
<Container className="mainContainer documentContainer postContainer">
3839
<div className="post">
3940
<header className="postHeader">
40-
<h2>Need help?</h2>
41+
<h2>
42+
<translate>Need help?</translate>
43+
</h2>
4144
</header>
4245
<p>
43-
If you've encountered a bug with React Navigation, please{' '}
46+
<translate>If you've encountered a bug with React Navigation, please</translate>{' '}
4447
<a href="https://github.com/react-navigation/react-navigation/issues">
45-
post an issue
48+
<translate>post an issue</translate>
4649
</a>{' '}
47-
and be sure to fill out the issue template. If you believe there
48-
is a feature missing, please <a href="https://react-navigation.canny.io/feature-requests">create a feature request on
49-
Canny</a>, or if
50-
you're feeling up for the task of proposing an API for the
51-
feature, <a href="https://github.com/react-navigation/rfcs">submit a RFC!</a> If you just need some help, try joining us in the <code>#react-navigation</code> channel on <a href="https://discord.gg/4xEK3nD">Discord</a> or <a href="https://stackoverflow.com/questions/tagged/react-navigation">post a question to StackOverflow</a>.
50+
<translate>and be sure to fill out the issue template. If you believe there is a feature missing, please</translate>
51+
<a href="https://react-navigation.canny.io/feature-requests">
52+
<translate>create a feature request on Canny</translate>
53+
</a>
54+
<translate>, or if you're feeling up for the task of proposing an API for the feature, </translate>
55+
<a href="https://github.com/react-navigation/rfcs">
56+
<translate>submit a RFC!</translate>
57+
</a>
58+
<translate>If you just need some help, try joining us in the</translate>
59+
<code> react-navigation </code>
60+
<translate>channel on</translate>
61+
<a href="https://discord.gg/4xEK3nD"> Discord </a>
62+
<translate>or</translate>
63+
<a href="https://stackoverflow.com/questions/tagged/react-navigation">
64+
<translate>post a question to StackOverflow</translate>
65+
</a>.
5266
</p>
5367
<GridBlock contents={supportLinks} layout="threeColumn" />
5468
</div>

website/pages/en/index.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
const React = require('react');
99

10+
const translate = require("../../server/translate.js").translate;
1011
const CompLibrary = require('../../core/CompLibrary.js');
1112
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
1213
const Container = CompLibrary.Container;
@@ -48,14 +49,14 @@ class HomeSplash extends React.Component {
4849
<div className="section promoSection">
4950
<div className="promoRow">
5051
<div className="pluginRowBlock">
51-
<Button href="/docs/getting-started.html">
52-
Read guides
52+
<Button href={`/docs/${this.props.language}/getting-started.html`}>
53+
<translate>Read guides</translate>
5354
</Button>
54-
<Button href="/docs/api-reference.html">
55-
Read API Reference
55+
<Button href={`/docs/${this.props.language}/api-reference.html`}>
56+
<translate>Read API Reference</translate>
5657
</Button>
5758
<Button href="https://expo.io/@react-navigation/NavigationPlayground">
58-
Try the demo app
59+
<translate>Try the demo app</translate>
5960
</Button>
6061
{/* <Button href="https://snack.expo.io/@react-navigation/hello-world">Run "Hello World" in Snack</Button> */}
6162
</div>
@@ -94,31 +95,31 @@ class Index extends React.Component {
9495
contents={[
9596
{
9697
content:
97-
'Start quickly with built-in navigators that deliver a seamless out-of-the-box experience.',
98+
<translate>Start quickly with built-in navigators that deliver a seamless out-of-the-box experience.</translate>,
9899
// image: siteConfig.baseUrl + 'img/docusaurus.svg',
99100
imageAlign: 'top',
100-
title: 'Easy-to-use',
101+
title: <translate>Easy-to-use</translate>,
101102
},
102103
{
103104
content:
104-
'Platform-specific look-and-feel with smooth animations and gestures.',
105+
<translate>Platform-specific look-and-feel with smooth animations and gestures.</translate>,
105106
// image: siteConfig.baseUrl + 'img/docusaurus.svg',
106107
imageAlign: 'top',
107-
title: 'Components built for iOS and Android',
108+
title: <translate>Components built for iOS and Android</translate>,
108109
},
109110
{
110111
content:
111-
'If you know how to write apps using JavaScript you can customize any part of React Navigation.',
112+
<translate>If you know how to write apps using JavaScript you can customize any part of React Navigation.</translate>,
112113
// image: siteConfig.baseUrl + 'img/docusaurus.svg',
113114
imageAlign: 'top',
114-
title: 'Completely customizable',
115+
title: <translate>Completely customizable</translate>,
115116
},
116117
{
117118
content:
118-
"React Navigation is extensible at every layer&mdash; you can write your own navigators or even replace the user-facing API.",
119+
<translate>React Navigation is extensible at every layer&mdash; you can write your own navigators or even replace the user-facing API.</translate>,
119120
// image: siteConfig.baseUrl + 'img/docusaurus.svg',
120121
imageAlign: 'top',
121-
title: 'Extensible platform',
122+
title: <translate>Extensible platform</translate>,
122123
},
123124
]}
124125
layout="fourColumn"

0 commit comments

Comments
 (0)