Skip to content

Commit 019447c

Browse files
author
Brian Vaughn
committed
Added stub translations page
1 parent 8e77586 commit 019447c

File tree

2 files changed

+79
-4
lines changed

2 files changed

+79
-4
lines changed

src/components/LayoutHeader/Header.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import ExternalLinkSvg from 'templates/components/ExternalLinkSvg';
1515
import DocSearch from './DocSearch';
1616

1717
import logoSvg from 'icons/logo.svg';
18-
import languages from '../../../crowdin/languages.json';
19-
20-
// TODO Use languages array to power locale drop-down
2118

2219
const Header = ({location}: {location: Location}) => (
2320
<header
@@ -142,6 +139,10 @@ const Header = ({location}: {location: Location}) => (
142139

143140
<div
144141
css={{
142+
display: 'flex',
143+
alignItems: 'center',
144+
whiteSpace: 'nowrap',
145+
145146
[media.lessThan('medium')]: {
146147
display: 'none',
147148
},
@@ -152,7 +153,6 @@ const Header = ({location}: {location: Location}) => (
152153
<a
153154
css={{
154155
padding: '5px 10px',
155-
whiteSpace: 'nowrap',
156156
...fonts.small,
157157

158158
':hover': {
@@ -168,6 +168,30 @@ const Header = ({location}: {location: Location}) => (
168168
href="/versions">
169169
v{version}
170170
</a>
171+
<a
172+
css={{
173+
padding: 5,
174+
marginLeft: 10,
175+
display: 'inline-flex',
176+
...fonts.small,
177+
178+
':hover': {
179+
color: colors.brand,
180+
},
181+
182+
':focus': {
183+
outline: 0,
184+
backgroundColor: colors.lighter,
185+
borderRadius: 15,
186+
},
187+
}}
188+
alt="Translations"
189+
href="/translations">
190+
<svg width="20" height="20" viewBox="0 0 24 24">
191+
<path fill="none" d="M0 0h24v24H0z" />
192+
<path fill="currentColor" d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z" />
193+
</svg>
194+
</a>
171195
<a
172196
css={{
173197
padding: '5px 10px',

src/pages/translations.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright (c) 2013-present, Facebook, Inc.
3+
*
4+
* @emails react-core
5+
* @flow
6+
*/
7+
8+
import Container from 'components/Container';
9+
import Header from 'components/Header';
10+
import TitleAndMetaTags from 'components/TitleAndMetaTags';
11+
import Link from 'gatsby-link';
12+
import React from 'react';
13+
import {sharedStyles} from 'theme';
14+
15+
// $FlowFixMe This is a valid path
16+
import languages from '../../crowdin/languages.json';
17+
18+
const Translations = () => (
19+
<Container>
20+
<div css={sharedStyles.articleLayout.container}>
21+
<div css={sharedStyles.articleLayout.content}>
22+
<Header>Translations</Header>
23+
<TitleAndMetaTags title="React - Translations" />
24+
<div css={sharedStyles.markdown}>
25+
<p>
26+
React docs have been translated by the community into the following languages:
27+
</p>
28+
<ul>
29+
{languages.map(language => (
30+
<li key={language}>
31+
<Link
32+
to={`/${language}/docs/hello-world.html`}>
33+
{language}
34+
</Link>
35+
</li>
36+
))}
37+
</ul>
38+
<p>
39+
Visit <a
40+
href="https://crowdin.com/project/react"
41+
target="_blank"
42+
rel="noopener">crowdin.com/project/react
43+
</a> if you would like to contribute to these translations.
44+
</p>
45+
</div>
46+
</div>
47+
</div>
48+
</Container>
49+
);
50+
51+
export default Translations;

0 commit comments

Comments
 (0)