File tree Expand file tree Collapse file tree 2 files changed +79
-4
lines changed Expand file tree Collapse file tree 2 files changed +79
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ import ExternalLinkSvg from 'templates/components/ExternalLinkSvg';
15
15
import DocSearch from './DocSearch' ;
16
16
17
17
import logoSvg from 'icons/logo.svg' ;
18
- import languages from '../../../crowdin/languages.json' ;
19
-
20
- // TODO Use languages array to power locale drop-down
21
18
22
19
const Header = ( { location} : { location : Location } ) => (
23
20
< header
@@ -142,6 +139,10 @@ const Header = ({location}: {location: Location}) => (
142
139
143
140
< div
144
141
css = { {
142
+ display : 'flex' ,
143
+ alignItems : 'center' ,
144
+ whiteSpace : 'nowrap' ,
145
+
145
146
[ media . lessThan ( 'medium' ) ] : {
146
147
display : 'none' ,
147
148
} ,
@@ -152,7 +153,6 @@ const Header = ({location}: {location: Location}) => (
152
153
< a
153
154
css = { {
154
155
padding : '5px 10px' ,
155
- whiteSpace : 'nowrap' ,
156
156
...fonts . small ,
157
157
158
158
':hover' : {
@@ -168,6 +168,30 @@ const Header = ({location}: {location: Location}) => (
168
168
href = "/versions" >
169
169
v{ version }
170
170
</ 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 >
171
195
< a
172
196
css = { {
173
197
padding : '5px 10px' ,
Original file line number Diff line number Diff line change
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 ;
You can’t perform that action at this time.
0 commit comments