Skip to content

Commit 75661cf

Browse files
authored
Merge pull request #1379 from ethereum/contributing-translations
Contributing translations
2 parents 1ac7c87 + e72f6d6 commit 75661cf

File tree

6 files changed

+113
-124
lines changed

6 files changed

+113
-124
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import React, { useState, useEffect } from "react"
2+
import { Link as GatsbyLink } from "gatsby"
3+
import styled from "styled-components"
4+
import axios from "axios"
5+
import { FakeLink } from "./SharedStyledComponents"
6+
7+
const LangContainer = styled.div`
8+
margin-bottom: 2rem;
9+
display: flex;
10+
flex-wrap: wrap;
11+
`
12+
13+
const LangItem = styled(GatsbyLink)`
14+
text-decoration: none;
15+
margin: 1rem 1rem 1rem 0;
16+
padding: 1rem;
17+
flex: 1 1 200px;
18+
list-style: none;
19+
border-radius: 0.5rem;
20+
width: 100%;
21+
border: 1px dotted ${(props) => props.theme.colors.lightBorder};
22+
box-shadow: 0 1px 4px ${(props) => props.theme.colors.boxShadow};
23+
transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
24+
color: ${(props) => props.theme.colors.text};
25+
26+
&:hover {
27+
box-shadow: 0 4px 8px ${(props) => props.theme.colors.boxShadowHover};
28+
border: 1px dotted ${(props) => props.theme.colors.primary};
29+
}
30+
`
31+
32+
const TranslationsInProgress = () => {
33+
const [translationsInProgress, setTranslationsInProgress] = useState([])
34+
35+
useEffect(() => {
36+
axios
37+
.get("/.netlify/functions/translations")
38+
.then((response) => {
39+
let languages = []
40+
if (response.data && response.data.data) {
41+
languages = response.data.data
42+
}
43+
languages.sort((a, b) => a.name.localeCompare(b.name))
44+
setTranslationsInProgress(languages)
45+
})
46+
.catch((error) => {
47+
// TODO add toast message on fails
48+
console.error(error)
49+
})
50+
}, [])
51+
52+
return (
53+
<LangContainer>
54+
{translationsInProgress.map((lang) => {
55+
const url = `https://crowdin.com/project/ethereumfoundation/${lang.code}`
56+
return (
57+
<LangItem to={url} key={lang.code}>
58+
<h4>{lang.name}</h4>
59+
<div>Translation progress: {lang.translated_progress}%</div>
60+
<div>Review progress: {lang.approved_progress}%</div>
61+
<FakeLink>Contribute</FakeLink>
62+
</LangItem>
63+
)
64+
})}
65+
</LangContainer>
66+
)
67+
}
68+
69+
export default TranslationsInProgress

src/content/contributing/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ethereum.org is an open-source project. So if you want to help improve [our port
1313

1414
- [Work on an open issue](https://github.com/ethereum/ethereum-org-website/issues)
1515
_– Work we've identified that needs doing_
16-
- [Join the translations program ](/en/languages/#ethereum-org-translation-program)
16+
- [Join the translations program ](/en/contributing/translation-program/)
1717
_– Help us bring ethereum.org to new languages_
18-
- [Add community articles ](/en/contributing/adding-articles)
18+
- [Add community articles ](/en/contributing/adding-articles/)
1919
_– Add a helpful article to a relevant page_
2020
- [Add a product ](/en/contributing/adding-products/)
2121
_– Add a dapp or wallet to a relevant page_
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Translation Program
3+
lang: en
4+
description: How to contribute to ethereum.org's Translation Program
5+
sidebar: true
6+
---
7+
8+
# Translation Program
9+
10+
Interested in translating? Get involved! We're seeking volunteers to join 450+ community members who are working to translate the website into 30+ languages.
11+
12+
## How to join
13+
14+
1. **[Join our project on Crowdin](https://crowdin.com/project/ethereumfoundation/invite)**
15+
_You will need to create a Crowdin account if you don't already have one. Here's [documentation on how to use Crowdin](https://support.crowdin.com/online-editor/)_
16+
17+
2. **Find the language you want to translate and select a document. If translation progress is below 100%, please contribute! Don't see your language listed? [Open an issue](https://github.com/ethereum/ethereum-org-website/issues/new/choose)**
18+
_A note on content versions: we use version management within Crowdin to avoid translation delays for added content. When you check out a language (for example [Filipino](https://crowdin.com/project/ethereumfoundation/fil#) you'll see folders for each site version ("Contents v1.0", "Contents v1.1", etc.). We encourage you to translate the highest version of the content in order to provide the most up-to-date content to users. If you've already started working on a lower version, that's fine too! We'll add any completed version to the website._
19+
3. **Once you've completed the translation (i.e. all files for a content version display 100%), our professional translation service will review (and potentially edit) the content. Once the review is complete (i.e. review progress is 100%), we will add it to the website.**
20+
21+
Do you have any questions? Or want to collaborate with our team and other translators? Please post in the #translations channel of our [ethereum.org Discord server](https://discord.gg/6WX7E97)
22+
23+
Thank you for your participation in the ethereum.org Translation Program!
24+
25+
## In-progress translations
26+
27+
<TranslationsInProgress />

src/intl/en.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,6 @@
123123
"page-translations-interested": "Interested in contributing?",
124124
"page-translations-learn-more": "Learn more about our Translation Program",
125125
"page-translations-translations-available": "ethereum.org is available in the following languages",
126-
"page-translations-program": "ethereum.org Translation Program",
127-
"page-translations-program-intro": "Interested in translating? Get involved! We're seeking volunteers to join 450+ community members who are working to translate the website into 30+ languages. Here's how:",
128-
"page-translations-program-follow": "Follow",
129-
"page-translations-program-invite": "this invite link",
130-
"page-translations-program-join": "to join our project on Crowdin.",
131-
"page-translations-program-account": "You will need to create a Crowdin account if you don't already have one. Here's",
132-
"page-translations-program-docs": "documentation on how to use Crowdin",
133-
"page-translations-program-find": "Find the language you want to participate in and select a document to translate. If translation progress is below 100%, please contribute! Don't see your language listed?",
134-
"page-translations-program-issue": "Open an issue here",
135-
"page-translations-program-version": "A note on content versions: we use version management within Crowdin to avoid translation delays for added content. When you check out a language (e.g. ",
136-
"page-translations-program-filipino": "Filipino",
137-
"page-translations-program-version-two": "you'll see folders for each site version (i.e. \"Contents v1.0\", \"Contents v1.1\", etc.). We encourage you to translate the highest version of the content in order to provide the most up-to-date content to users. If you've already started working on a lower version, that's fine too! We'll add any completed version to the website",
138-
"page-translations-program-complete": "Once you've completed the translation (i.e. all files for a content version display 100%), our professional translation service will review (and potentially edit) the content. Once the review is complete (i.e. review progress is 100%), we will add it to the website.",
139-
"page-translations-program-question": "Do you have any questions? Or want to collaborate with our team and other translators? Please join our ",
140-
"page-translations-program-discord": "ethereum.org Discord server",
141-
"page-translations-program-channel": "and post in the #translations channel",
142-
"page-translations-program-participate": "Thank you for your participation in the ethereum.org Translation Program!",
143-
"page-translations-translations-in-progress": "The following language translations are in progress",
144-
"page-translations-translation-progress": "Translation progress",
145-
"page-translations-review-progress": "Review progress",
146-
"page-translations-contribute": "Contribute",
147126
"page-use": "Use",
148127
"privacy-policy": "Privacy policy",
149128
"search": "Search",

src/pages/languages.js

Lines changed: 13 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from "react"
1+
import React from "react"
22
import { Link as GatsbyLink } from "gatsby"
33
import styled from "styled-components"
44
import { useIntl } from "gatsby-plugin-intl"
@@ -8,9 +8,7 @@ import { Mixins } from "../components/Theme"
88
import PageMetadata from "../components/PageMetadata"
99
import Translation from "../components/Translation"
1010
import Link from "../components/Link"
11-
import { PageContainer, FakeLink } from "../components/SharedStyledComponents"
12-
13-
import axios from "axios"
11+
import { PageContainer } from "../components/SharedStyledComponents"
1412

1513
const ContentContainer = styled.div`
1614
max-width: ${(props) => props.theme.breakpoints.m};
@@ -48,7 +46,6 @@ const LangTitle = styled.div`
4846

4947
const LanguagesPage = () => {
5048
const intl = useIntl()
51-
const [translationsInProgress, setTranslationsInProgress] = useState([])
5249

5350
let translationsCompleted = []
5451
for (const lang in languageMetadata) {
@@ -60,23 +57,6 @@ const LanguagesPage = () => {
6057
a["language-english"].localeCompare(b["language-english"])
6158
)
6259

63-
useEffect(() => {
64-
axios
65-
.get("/.netlify/functions/translations")
66-
.then((response) => {
67-
let languages = []
68-
if (response.data && response.data.data) {
69-
languages = response.data.data
70-
}
71-
languages.sort((a, b) => a.name.localeCompare(b.name))
72-
setTranslationsInProgress(languages)
73-
})
74-
.catch((error) => {
75-
// TODO add toast message on fails
76-
console.error(error)
77-
})
78-
}, [])
79-
8060
return (
8161
<PageContainer>
8262
<PageMetadata
@@ -92,9 +72,10 @@ const LanguagesPage = () => {
9272
</p>
9373
<p>
9474
<Translation id="page-translations-interested" />{" "}
95-
<a href="#ethereum-org-translation-program">
75+
<Link to="/en/contributing/translation-program/">
9676
<Translation id="page-translations-learn-more" />
97-
</a>
77+
</Link>
78+
.
9879
</p>
9980
<h2>
10081
<Translation id="page-translations-translations-available" />:
@@ -111,87 +92,18 @@ const LanguagesPage = () => {
11192
)
11293
})}
11394
</LangContainer>
114-
11595
<ContentContainer>
116-
<h2 id="ethereum-org-translation-program">
117-
<Translation id="page-translations-program" />
118-
</h2>
96+
<h2>Want to see ethereum.org in a different language?</h2>
11997
<p>
120-
<Translation id="page-translations-program-intro" />
98+
ethereum.org translators are always translating pages in as many
99+
languages as possible. To see what they're working on right now or to
100+
sign up to join them, read about our{" "}
101+
<Link to="/en/contributing/translation-program/">
102+
Translation Program
103+
</Link>
104+
.
121105
</p>
122-
<ol>
123-
<li>
124-
<Translation id="page-translations-program-follow" />{" "}
125-
<Link to="https://crowdin.com/project/ethereumfoundation/invite">
126-
<Translation id="page-translations-program-invite" />
127-
</Link>{" "}
128-
<Translation id="page-translations-program-join" />.
129-
<ul>
130-
<li>
131-
<Translation id="page-translations-program-account" />{" "}
132-
<Link to="https://support.crowdin.com/online-editor/">
133-
<Translation id="page-translations-program-docs" />
134-
</Link>
135-
.
136-
</li>
137-
</ul>
138-
</li>
139-
<li>
140-
<Translation id="page-translations-program-find" />{" "}
141-
<Link to="https://github.com/ethereum/ethereum-org-website/issues/new/choose">
142-
<Translation id="page-translations-program-issue" />
143-
</Link>
144-
.
145-
<ul>
146-
<li>
147-
<Translation id="page-translations-program-version" />{" "}
148-
<Link to="https://crowdin.com/project/ethereumfoundation/fil#">
149-
<Translation id="page-translations-program-filipino" />
150-
</Link>{" "}
151-
<Translation id="page-translations-program-version-two" />.
152-
</li>
153-
</ul>
154-
</li>
155-
<li>
156-
<Translation id="page-translations-program-complete" />
157-
</li>
158-
</ol>
159-
<p>
160-
<Translation id="page-translations-program-question" />{" "}
161-
<Link to="https://discord.gg/6WX7E97">
162-
<Translation id="page-translations-program-discord" />
163-
</Link>{" "}
164-
<Translation id="page-translations-program-channel" />.
165-
</p>
166-
<p>
167-
<Translation id="page-translations-program-participate" />.
168-
</p>
169-
<h2>
170-
<Translation id="page-translations-translations-in-progress" />:
171-
</h2>
172106
</ContentContainer>
173-
174-
<LangContainer>
175-
{translationsInProgress.map((lang) => {
176-
const url = `https://crowdin.com/project/ethereumfoundation/${lang.code}`
177-
return (
178-
<LangItem to={url} key={lang.code}>
179-
<h4>{lang.name}</h4>
180-
<div>
181-
<Translation id="page-translations-translation-progress" />:{" "}
182-
{lang.translated_progress}%
183-
</div>
184-
<div>
185-
<Translation id="page-translations-review-progress" />:{" "}
186-
{lang.approved_progress}%
187-
</div>
188-
<FakeLink>
189-
<Translation id="page-translations-contribute" />
190-
</FakeLink>
191-
</LangItem>
192-
)
193-
})}
194-
</LangContainer>
195107
</PageContainer>
196108
)
197109
}

src/templates/static.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import RandomAppList from "../components/RandomAppList"
2121
import Roadmap from "../components/Roadmap"
2222
import Sidebar from "../components/Sidebar"
2323
import Translation from "../components/Translation"
24+
import TranslationsInProgress from "../components/TranslationsInProgress"
2425
import Warning from "../components/Warning"
2526
import SectionNav from "../components/SectionNav"
2627
import { Mixins } from "../components/Theme"
@@ -250,6 +251,7 @@ const components = {
250251
SectionNav,
251252
Pill,
252253
Twemoji,
254+
TranslationsInProgress,
253255
}
254256

255257
const StaticPage = ({ data: { mdx } }) => {

0 commit comments

Comments
 (0)