Skip to content

Commit 0478c0f

Browse files
committed
use crowdin action for translation sync
1 parent 849eee8 commit 0478c0f

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

.github/workflows/cron-translations.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,28 @@ on:
44
schedule:
55
- cron: "7 0 * * *" # every day at 00:07 UTC
66
workflow_dispatch:
7+
push:
8+
branches: ["main"]
79

810
jobs:
911
crowdin-pull:
1012
runs-on: ubuntu-latest
1113
if: github.repository == 'go-gitea/gitea'
1214
steps:
1315
- uses: actions/checkout@v4
14-
- name: download from crowdin
15-
uses: docker://jonasfranz/crowdin
16+
- uses: crowdin/github-action@v1
17+
with:
18+
upload_sources: true
19+
upload_translations: false
20+
download_sources: false
21+
download_translations: true
22+
push_translations: false
23+
push_sources: false
24+
create_pull_request: false
25+
config: crowdin.yml
1626
env:
27+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
1728
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
18-
PLUGIN_DOWNLOAD: true
19-
PLUGIN_EXPORT_DIR: options/locale/
20-
PLUGIN_IGNORE_BRANCH: true
21-
PLUGIN_PROJECT_IDENTIFIER: gitea
2229
- name: update locales
2330
run: ./build/update-locales.sh
2431
- name: push translations to repo
@@ -31,19 +38,3 @@ jobs:
3138
commit_message: "[skip ci] Updated translations via Crowdin"
3239
remote: "[email protected]:go-gitea/gitea.git"
3340
ssh_key: ${{ secrets.DEPLOY_KEY }}
34-
crowdin-push:
35-
runs-on: ubuntu-latest
36-
if: github.repository == 'go-gitea/gitea'
37-
steps:
38-
- uses: actions/checkout@v4
39-
- name: push translations to crowdin
40-
uses: docker://jonasfranz/crowdin
41-
env:
42-
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
43-
PLUGIN_UPLOAD: true
44-
PLUGIN_EXPORT_DIR: options/locale/
45-
PLUGIN_IGNORE_BRANCH: true
46-
PLUGIN_PROJECT_IDENTIFIER: gitea
47-
PLUGIN_FILES: |
48-
locale_en-US.ini: options/locale/locale_en-US.ini
49-
PLUGIN_BRANCH: main

crowdin.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project_id_env: CROWDIN_PROJECT_ID
2+
api_token_env: CROWDIN_KEY
3+
base_path: "."
4+
base_url: "https://api.crowdin.com"
5+
preserve_hierarchy: true
6+
files:
7+
- source: "/options/locale/locale_en-US.ini"
8+
translation: "/options/locale/locale_%locale%.ini"
9+
type: "ini"
10+
skip_untranslated_strings: true
11+
export_only_approved: true
12+
update_option: "update_as_unapproved"

0 commit comments

Comments
 (0)