Skip to content

Commit f32ce75

Browse files
authored
Use Crowdin action for translation sync (go-gitea#30054)
Switch from the old self-built action to the official one. We get: - config managed inside the repo - automatic upload when source file changes - automatic invalidation if source string changes (tested) - automatic download of new translation files Tested both upload and download.
1 parent b535c6c commit f32ce75

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

.github/workflows/cron-translations.yml

+11-22
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ jobs:
1111
if: github.repository == 'go-gitea/gitea'
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: download from crowdin
15-
uses: docker://jonasfranz/crowdin
14+
- uses: crowdin/github-action@v1
15+
with:
16+
upload_sources: true
17+
upload_translations: false
18+
download_sources: false
19+
download_translations: true
20+
push_translations: false
21+
push_sources: false
22+
create_pull_request: false
23+
config: crowdin.yml
1624
env:
25+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
1726
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
2227
- name: update locales
2328
run: ./build/update-locales.sh
2429
- name: push translations to repo
@@ -31,19 +36,3 @@ jobs:
3136
commit_message: "[skip ci] Updated translations via Crowdin"
3237
remote: "[email protected]:go-gitea/gitea.git"
3338
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

+12
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)