Skip to content

Commit ef3d440

Browse files
authored
Add Crowdin action (JabRef#13007)
1 parent 0756fcc commit ef3d440

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

.github/workflows/automerge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
(
1818
startsWith(github.event.pull_request.title, '[Bot] ') ||
1919
startsWith(github.event.pull_request.title, 'Bump ') ||
20-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
20+
startsWith(github.event.pull_request.title, 'New Crowdin Translations') ||
2121
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
2222
)
2323
)

.github/workflows/crowdin.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Crowdin Action
2+
3+
on:
4+
push:
5+
branches:
6+
- use-crowdin-action
7+
schedule:
8+
# run on each Wednesday
9+
- cron: '2 3 * * 3'
10+
workflow_dispatch:
11+
12+
jobs:
13+
synchronize-with-crowdin:
14+
if: github.repository == 'JabRef/jabref'
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: crowdin action
22+
uses: crowdin/github-action@v2
23+
with:
24+
upload_sources: true
25+
upload_translations: false
26+
upload_language: de
27+
download_translations: true
28+
localization_branch_name: l10n_crowdin_translations
29+
create_pull_request: true
30+
pull_request_title: 'New Crowdin Translations'
31+
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
32+
pull_request_base_branch_name: 'main'
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE }}
35+
36+
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
37+
CROWDIN_PROJECT_ID: 294858
38+
39+
# Visit https://crowdin.com/settings#api-key to create this token
40+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/on-pr-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
(
1515
startsWith(github.event.pull_request.title, '[Bot] ') ||
1616
startsWith(github.event.pull_request.title, 'Bump ') ||
17-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
17+
startsWith(github.event.pull_request.title, 'New Crowdin Translations') ||
1818
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
1919
)
2020
)

.github/workflows/on-pr-opened-updated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
(
1616
startsWith(github.event.pull_request.title, '[Bot] ') ||
1717
startsWith(github.event.pull_request.title, 'Bump ') ||
18-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
18+
startsWith(github.event.pull_request.title, 'New Crowdin Translations') ||
1919
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
2020
)
2121
)

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ jobs:
331331
(
332332
startsWith(github.event.pull_request.title, '[Bot] ') ||
333333
startsWith(github.event.pull_request.title, 'Bump ') ||
334-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
334+
startsWith(github.event.pull_request.title, 'New Crowdin Translations') ||
335335
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
336336
)
337337
)
@@ -367,7 +367,7 @@ jobs:
367367
(
368368
startsWith(github.event.pull_request.title, '[Bot] ') ||
369369
startsWith(github.event.pull_request.title, 'Bump ') ||
370-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
370+
startsWith(github.event.pull_request.title, 'New Crowdin Translations') ||
371371
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
372372
)
373373
)

crowdin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
files:
2-
- source: /src/main/resources/l10n/JabRef_en.properties
3-
translation: /src/main/resources/l10n/JabRef_%two_letters_code%.properties
2+
- source: /jablib/src/main/resources/l10n/JabRef_en.properties
3+
translation: /jablib/src/main/resources/l10n/JabRef_%two_letters_code%.properties
44
languages_mapping:
55
two_letters_code:
66
pt-BR: pt_BR

0 commit comments

Comments
 (0)