Skip to content

Commit 72ae932

Browse files
gaearontesseralisbvaughn
authored
Simplify the translation infra (#285)
* Simplify translation infra Co-authored-by: Nat Alison <[email protected]> Co-authored-by: Brian Vaughn <[email protected]> * Add a local create-translation workflow --------- Co-authored-by: Nat Alison <[email protected]> Co-authored-by: Brian Vaughn <[email protected]>
1 parent 37437cb commit 72ae932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+7543
-1111
lines changed

.github/workflows/sync-batch-1.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync CI (batch 1)
2+
3+
on:
4+
schedule:
5+
# Run this job every Monday at 12am
6+
- cron: "0 0 * * 1"
7+
8+
env:
9+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
10+
USER_NAME: ${{ secrets.USER_NAME }}
11+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
12+
13+
defaults:
14+
run:
15+
working-directory: ./scripts
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [16.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'yarn'
33+
- run: yarn install
34+
- run: ACTIONS_BATCH_PATTERN=6:1 yarn sync-translations

.github/workflows/sync-batch-2.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync CI (batch 2)
2+
3+
on:
4+
schedule:
5+
# Run this job every Monday at 1am
6+
- cron: "0 1 * * 1"
7+
8+
env:
9+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
10+
USER_NAME: ${{ secrets.USER_NAME }}
11+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
12+
13+
defaults:
14+
run:
15+
working-directory: ./scripts
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [16.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'yarn'
33+
- run: yarn install
34+
- run: ACTIONS_BATCH_PATTERN=6:2 yarn sync-translations

.github/workflows/sync-batch-3.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync CI (batch 3)
2+
3+
on:
4+
schedule:
5+
# Run this job every Monday at 2am
6+
- cron: "0 2 * * 1"
7+
8+
env:
9+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
10+
USER_NAME: ${{ secrets.USER_NAME }}
11+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
12+
13+
defaults:
14+
run:
15+
working-directory: ./scripts
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [16.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'yarn'
33+
- run: yarn install
34+
- run: ACTIONS_BATCH_PATTERN=6:3 yarn sync-translations

.github/workflows/sync-batch-4.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync CI (batch 4)
2+
3+
on:
4+
schedule:
5+
# Run this job every Monday at 3am
6+
- cron: "0 3 * * 1"
7+
8+
env:
9+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
10+
USER_NAME: ${{ secrets.USER_NAME }}
11+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
12+
13+
defaults:
14+
run:
15+
working-directory: ./scripts
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [16.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'yarn'
33+
- run: yarn install
34+
- run: ACTIONS_BATCH_PATTERN=6:4 yarn sync-translations

.github/workflows/sync-batch-5.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync CI (batch 5)
2+
3+
on:
4+
schedule:
5+
# Run this job every Monday at 4am
6+
- cron: "0 4 * * 1"
7+
8+
env:
9+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
10+
USER_NAME: ${{ secrets.USER_NAME }}
11+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
12+
13+
defaults:
14+
run:
15+
working-directory: ./scripts
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [16.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'yarn'
33+
- run: yarn install
34+
- run: ACTIONS_BATCH_PATTERN=6:5 yarn sync-translations

.github/workflows/sync-batch-6.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sync CI (batch 6)
2+
3+
on:
4+
schedule:
5+
# Run this job every Monday at 5am
6+
- cron: "0 5 * * 1"
7+
8+
env:
9+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
10+
USER_NAME: ${{ secrets.USER_NAME }}
11+
USER_EMAIL: ${{ secrets.USER_EMAIL }}
12+
13+
defaults:
14+
run:
15+
working-directory: ./scripts
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [16.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'yarn'
33+
- run: yarn install
34+
- run: ACTIONS_BATCH_PATTERN=6:6 yarn sync-translations

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ npm-debug.log
66
yarn-error.log
77
!.gitkeep
88

9+
.temp
910
.env*
1011
!.env.sample

PROGRESS.template.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
## Maintainer List
2-
3-
{MAINTAINERS}
4-
51
## For New Translators
62

73
To translate a page:
@@ -19,13 +15,13 @@ Please be prompt with your translations! If you find that you can't commit anymo
1915
When someone volunteers, edit this issue with the username of the volunteer, and with the PR. Ex:
2016

2117
```
22-
- [ ] Quick Start (@tesseralis) #12345
18+
- [ ] Some Page (@exampleusername) #12345
2319
```
2420

2521
When PRs are merged, make sure to mark that page as completed like this:
2622

2723
```
28-
- [x] Quick Start (@tesseralis) #12345
24+
- [x] Some Page (@exampleusername) #12345
2925
```
3026

3127
This ensures your translation's progress is tracked correctly at https://translations.react.dev/.
@@ -179,3 +175,11 @@ These aren't the main translation targets, but if you'd like to do them, feel fr
179175
- [ ] Community
180176
- [ ] Blog
181177
- [ ] Warnings
178+
179+
## Maintainer List
180+
181+
This translation is maintained by:
182+
183+
{MAINTAINERS}
184+
185+
If you want to become a maintainer, ask them to add you. If the original maintainers are no longer responsive, raise an issue in the [main translations repository](https://github.com/reactjs/translations.react.dev).

README.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,30 @@ Check [translations.react.dev](https://translations.react.dev/) to see if your l
88

99
## Starting a new translation
1010

11-
If you would like to be the maintainer of a new translation, submit a PR adding a new file `{lang-code}.json`
12-
to the `langs` folder with the following information:
11+
If you would like to be the maintainer of a new translation, submit a PR adding it to the list in `langs/langs.json` with the following information:
1312

14-
* Language name (in English please)
1513
* [Language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
16-
* List of maintainers
14+
* Language name (in your language)
15+
* Language name (in English)
1716

1817
For example:
1918

2019
```json
21-
{
22-
"name": "English",
23-
"code": "en",
24-
"maintainers": ["gaearon", "tesseralis"]
25-
}
20+
{ "code": "fr", "name": "Français", "enName": "French" },
2621
```
2722

28-
In the PR comment, please describe your experiences with translation (e.g. links to previous work). We prefer more than one maintainer on each repo, so if you're by yourself, we'll leave the PR open for others to join in. If you are a group, please have at least one person other than the PR opener comment, to make sure all people listed actually want to be part of the translation!
23+
In the PR comment, please describe your experiences with translation (e.g. links to previous work) and mention all the initial translation maintainers. We prefer more than one maintainer on each repo, so if you're by yourself, we'll leave the PR open for others to join in. If you are a group, please have at least one person other than the PR opener comment, to make sure all people listed actually want to be part of the translation!
2924

3025
Also, please read the [Maintainer Responsibilities](/maintainer-guide.md#maintainer-responsibilities) and make sure that you are comfortable with the responsibilities listed.
3126

32-
Once the PR is accepted, the bot will:
27+
Once the PR is accepted, a member of the React team will [run a script](/scripts/README.md#creating-a-translation) which will:
3328

3429
* Create a new repository for you at `reactjs/{lang-code}.react.dev`
35-
* Add/invite all maintainers listed to a "react.dev {language} Translation" team in the reactjs organization
30+
* Add/invite all maintainers you provided in the PR comment as administrators of the new repo
3631
* Create an issue from [PROGRESS.template.md](/PROGRESS.template.md) in the new repository to track your translation progress
3732

33+
File an issue on this repository to apply for a real `{lang-code}.react.dev` subdomain once you have a few sections translated and can show sustained progress. Until then, the translation will be hosted at a preview domain.
34+
3835
If you are not a member of the reactjs organization, you should receive an email invite to join. Please accept this invite so you can get admin access to your repository!
3936

4037
You may want to [pin](https://help.github.com/articles/pinning-an-issue-to-your-repository/) the generated issue to make it easier to find.
@@ -45,10 +42,12 @@ Happy translating!
4542

4643
## Adding a maintainer
4744

48-
If you are currently a maintainer of a translation and want to add another member, send a pull request to this repo updating `langs/{lang-code}.json`, where `{lang-code}` is the language code of the repo you want to be a maintainer of.
45+
If you are currently a maintainer of a translation and want to add another member, do it directly in the Settings panel of your repo.
4946

5047
If you are interested in becoming a maintainer for a translation, please ask one of the current maintainers if they would like to add you. While different maintainers can have different requirements, usually they look for people who have already contributed to the translation already, either by translating or reviewing.
5148

49+
If the translation's existing maintainers become unresponsible for more than a month, please raise an issue on this repository. If you don't receive a response in a week, please escalate the issue to the main React repository.
50+
5251
## Before publishing
5352

5453
1. Review your translations and make sure that the pages listed in "Main Content" are fully translated. Run the site yourself locally to make sure there are no bugs or missing translations.

langs/ar.json

-5
This file was deleted.

langs/az.json

-5
This file was deleted.

langs/de.json

-5
This file was deleted.

langs/es.json

-5
This file was deleted.

langs/fa.json

-7
This file was deleted.

langs/fr.json

-5
This file was deleted.

langs/he.json

-5
This file was deleted.

langs/hi.json

-5
This file was deleted.

langs/hu.json

-5
This file was deleted.

langs/id.json

-5
This file was deleted.

langs/it.json

-5
This file was deleted.

langs/ja.json

-5
This file was deleted.

langs/ko.json

-5
This file was deleted.

0 commit comments

Comments
 (0)