Skip to content

Commit ed2310f

Browse files
Merge remote-tracking branch 'upstream/dev' into refactor/update-hero-ds
2 parents 36900f0 + bae037f commit ed2310f

File tree

130 files changed

+2469
-1530
lines changed

Some content is hidden

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

130 files changed

+2469
-1530
lines changed

.all-contributorsrc

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12042,6 +12042,78 @@
1204212042
"contributions": [
1204312043
"doc"
1204412044
]
12045+
},
12046+
{
12047+
"login": "woxjro",
12048+
"name": "woxjro",
12049+
"avatar_url": "https://avatars.githubusercontent.com/u/63214188?v=4",
12050+
"profile": "https://github.com/woxjro",
12051+
"contributions": [
12052+
"tool"
12053+
]
12054+
},
12055+
{
12056+
"login": "SeanXLChen",
12057+
"name": "bambooskySean",
12058+
"avatar_url": "https://avatars.githubusercontent.com/u/78134555?v=4",
12059+
"profile": "https://github.com/SeanXLChen",
12060+
"contributions": [
12061+
"code"
12062+
]
12063+
},
12064+
{
12065+
"login": "VikVM",
12066+
"name": "VikVM",
12067+
"avatar_url": "https://avatars.githubusercontent.com/u/60881781?v=4",
12068+
"profile": "https://github.com/VikVM",
12069+
"contributions": [
12070+
"content"
12071+
]
12072+
},
12073+
{
12074+
"login": "checkomkar",
12075+
"name": "Omkar Kamale",
12076+
"avatar_url": "https://avatars.githubusercontent.com/u/8987373?v=4",
12077+
"profile": "https://github.com/checkomkar",
12078+
"contributions": [
12079+
"code"
12080+
]
12081+
},
12082+
{
12083+
"login": "mingoing",
12084+
"name": "Mingo",
12085+
"avatar_url": "https://avatars.githubusercontent.com/u/344175?v=4",
12086+
"profile": "https://github.com/mingoing",
12087+
"contributions": [
12088+
"doc"
12089+
]
12090+
},
12091+
{
12092+
"login": "zkVlad",
12093+
"name": "zkVlad",
12094+
"avatar_url": "https://avatars.githubusercontent.com/u/125317045?v=4",
12095+
"profile": "https://github.com/zkVlad",
12096+
"contributions": [
12097+
"doc"
12098+
]
12099+
},
12100+
{
12101+
"login": "yunseonna",
12102+
"name": "yunseon na",
12103+
"avatar_url": "https://avatars.githubusercontent.com/u/148749864?v=4",
12104+
"profile": "https://github.com/yunseonna",
12105+
"contributions": [
12106+
"doc"
12107+
]
12108+
},
12109+
{
12110+
"login": "alex1092",
12111+
"name": "Alex",
12112+
"avatar_url": "https://avatars.githubusercontent.com/u/59183749?v=4",
12113+
"profile": "https://github.com/alex1092",
12114+
"contributions": [
12115+
"code"
12116+
]
1204512117
}
1204612118
],
1204712119
"contributorsPerLine": 7,

.github/labeler.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
"needs review 👀":
2-
- src/**/*
3-
- public/*
4-
51
"documentation 📖":
62
- README.md
3+
- docs/**/*
74

85
"tooling 🔧":
96
- .github/**/*
10-
- src/scripts/*
11-
- src/lib/*
12-
- src/hooks/*
7+
- src/scripts/**/*
8+
- src/lib/**/*
9+
- src/hooks/**/*
10+
- .storybook/**/*
1311

1412
"dependencies 📦":
1513
- package.json
1614
- yarn.lock
1715

18-
"internal 🏠":
19-
- .all-contributorsrc
16+
"config ⚙️":
2017
- i18n.config.json
2118
- next.config.js
2219
- next-i18next.config,js
@@ -30,12 +27,11 @@
3027
- netlify.toml
3128

3229
"translation 🌍":
33-
- src/content/translations/**/*
30+
- public/content/translations/**/*
3431
- src/intl/**/*
35-
- src/lib/utils/translations.ts
3632

3733
"content 🖋️":
38-
- src/pages/*
34+
- src/intl/en/**
3935
- public/content/**/*
4036

4137
"event 📅":

.github/workflows/build-crowdin.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/crowdin-ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Crowdin CI
2+
3+
on:
4+
schedule:
5+
- cron: "20 4 1 * *" # Runs at 4:20 AM on the first day of every month
6+
workflow_dispatch: # Can be dispatched manually
7+
8+
jobs:
9+
create_approved_language_bucket_prs:
10+
runs-on: ubuntu-latest
11+
env:
12+
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
13+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
steps:
17+
# Set up environment
18+
- name: Check out code
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
25+
26+
- name: Install dependencies
27+
run: yarn install
28+
29+
- name: Install ts-node
30+
run: yarn global add ts-node
31+
32+
- name: Set up git
33+
run: |
34+
git config --global user.email "[email protected]"
35+
git config --global user.name "GitHub Action"
36+
37+
- name: Fetch latest dev
38+
run: git fetch origin dev
39+
40+
# Build translations
41+
- name: Build Crowdin project
42+
id: build-crowdin
43+
run: |
44+
npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/triggerBuild.ts;
45+
grep BUILD_ID output.env >> $GITHUB_ENV;
46+
47+
- name: Await latest build to finish
48+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/awaitLatestBuild.ts
49+
50+
- name: Check build success
51+
run: |
52+
if [ $(grep BUILD_SUCCESS output.env | cut -d'=' -f2) = false ]; then
53+
echo "Build timed out, exiting"
54+
exit 1
55+
fi
56+
shell: bash
57+
58+
# Prepare bucket ids
59+
- name: Get latest translation bucket directory ids
60+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/getBucketDirectoryIds.ts
61+
62+
# Import approved translations
63+
- name: Get translations
64+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/getTranslations.ts
65+
66+
# Post updates as language-specific PRs
67+
- name: Process commits and post PRs by language
68+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/postLangPRs.ts

.github/workflows/get-translations.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/label.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,26 @@ jobs:
1111
- uses: actions/labeler@v2
1212
with:
1313
repo-token: "${{ secrets.GITHUB_TOKEN }}"
14+
15+
- name: Refine labels
16+
uses: actions/github-script@v5
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
script: |
20+
try {
21+
const { owner, repo, number: pull_number } = context.issue;
22+
const { data: files } = await github.pulls.listFiles({ owner, repo, pull_number });
23+
24+
const allInEn = files.every(file => file.filename.startsWith('src/intl/en/'));
25+
const allInTranslations = files.every(file => file.filename.startsWith('public/content/translations/'));
26+
27+
if (allInEn) {
28+
await github.issues.removeLabel({ owner, repo, issue_number: pull_number, name: 'translation 🌍' });
29+
}
30+
31+
if (allInTranslations) {
32+
await github.issues.removeLabel({ owner, repo, issue_number: pull_number, name: 'content 🖋️' });
33+
}
34+
} catch (error) {
35+
console.warn("Problem occurred refining labels")
36+
}

.github/workflows/non-english-warning.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@ on:
55
paths:
66
- "public/content/translations/**/*.md"
77
- "src/intl/**/*.json"
8-
- "!src/intl/en/**
8+
- "!src/intl/en/**"
99

1010
jobs:
11-
check_branch_name:
11+
check_and_label:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Exit early if branch name contains 'crowdin'
14+
- name: Exit early if branch name contains 'crowdin' or is 'dev', 'staging', or 'master'
15+
id: check_branch
1516
run: |
16-
if [[ "${{ github.head_ref }}" == *crowdin* ]]; then
17-
echo "Branch name contains 'crowdin', stopping workflow"
18-
exit 1
17+
if [[ "${{ github.head_ref }}" == *crowdin* ]] ||
18+
[[ "${{ github.ref }}" == 'refs/heads/dev' ]] ||
19+
[[ "${{ github.ref }}" == 'refs/heads/staging' ]] ||
20+
[[ "${{ github.ref }}" == 'refs/heads/master' ]]
21+
then
22+
echo "Branch name contains 'crowdin' or is 'dev', 'staging', or 'master', stopping workflow"
23+
echo "::set-output name=skip::true"
24+
exit 0
25+
else
26+
echo "::set-output name=skip::false"
1927
fi
2028
21-
check_changes:
22-
needs: check_branch_name
23-
runs-on: ubuntu-latest
24-
outputs:
25-
all_changes_include_href: ${{ steps.check.outputs.all_changes_include_href }}
26-
steps:
2729
- name: Checkout code
30+
if: steps.check_branch.outputs.skip == 'false'
2831
uses: actions/checkout@v2
32+
2933
- name: Check changes
30-
id: check
34+
if: steps.check_branch.outputs.skip == 'false'
35+
id: check_changes
3136
run: |
3237
git fetch origin ${{ github.base_ref }}
3338
DIFF=$(git diff --no-ext-diff --unified=0 origin/${{ github.base_ref }}..${{ github.head_ref }} -- 'public/content/translations/**/*.md' 'src/intl/**/*.json' '!src/intl/en/**' | grep -E -v '^[-+]href=')
@@ -38,27 +43,24 @@ jobs:
3843
fi
3944
echo "::set-output name=all_changes_include_href::$ALL_CHANGES_INCLUDE_HREF"
4045
41-
add_label_and_comment:
42-
needs: check_changes
43-
runs-on: ubuntu-latest
44-
steps:
4546
- name: Add label and comment
47+
if: steps.check_branch.outputs.skip == 'false'
4648
uses: actions/github-script@v5
4749
with:
4850
github-token: ${{secrets.GITHUB_TOKEN}}
4951
script: |
5052
const prNumber = context.issue.number;
5153
const repo = context.repo;
5254
const prAuthor = context.payload.pull_request.user.login;
53-
const allChangesIncludeHref = '${{ needs.check_changes.outputs.all_changes_include_href }}' === 'true';
54-
const status = allChangesIncludeHref ? 'question ❓' : 'blocked 🛑';
55+
const allChangesIncludeHref = '${{ steps.check_changes.outputs.all_changes_include_href }}' === 'true';
56+
const status = allChangesIncludeHref ? 'question ❓' : 'Status: Blocked 🛑';
5557
await github.rest.issues.addLabels({
5658
...repo,
5759
issue_number: prNumber,
5860
labels: [status, 'non-crowdin translation updates']
5961
});
6062
const commentWithoutHrefs = `This pull request contains changes to non-English content, which must also be handled through the Crowdin platform instead of only on GitHub.`
61-
const commentWithHrefs = `This pull request contains changes to non-English content files, which may also need to be handled through the Crowdin platform instead of only on GitHub.
63+
const commentWithHrefs = `This pull request contains changes to non-English content files, which may also need to be handled through the Crowdin platform instead of only on GitHub.`
6264
await github.rest.issues.createComment({
6365
...repo,
6466
issue_number: prNumber,
@@ -71,4 +73,4 @@ jobs:
7173
7274
Please post here or join [our Discord](https://ethereum.org/discord) if you have questions!
7375
`
74-
});
76+
});

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ robots.txt
5050
# .crowdin folder used as temp forlder for crowdin-import script
5151
.crowdin
5252

53-
# vscode workplace configuration
53+
# workplace configuration
5454
.vscode
55+
.idea
5556

5657
# Crowdin report output
57-
src/data/crowdin/bucketsAwaitingReviewReport.csv
58+
src/data/crowdin/bucketsAwaitingReviewReport.csv

0 commit comments

Comments
 (0)