Skip to content

Commit 5388fd5

Browse files
committed
WIP
1 parent cf686e1 commit 5388fd5

File tree

2 files changed

+19
-44
lines changed

2 files changed

+19
-44
lines changed

.github/workflows/cron-translations.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,29 @@ 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: false
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+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
28+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
1729
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
2230
- name: update locales
2331
run: ./build/update-locales.sh
2432
- name: push translations to repo
@@ -31,19 +39,3 @@ jobs:
3139
commit_message: "[skip ci] Updated translations via Crowdin"
3240
remote: "[email protected]:go-gitea/gitea.git"
3341
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: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
1-
"project_id_env": "CROWDIN_PROJECT_ID"
2-
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
1+
project_id_env: CROWDIN_PROJECT_ID
2+
api_token_env: CROWDIN_KEY
33
base_path: "."
44
base_url: "https://api.crowdin.com"
5-
6-
# Choose file structure in Crowdin
7-
# e.g. true or false
85
preserve_hierarchy: true
9-
10-
# Files configuration
116
files:
12-
# Source files filter
13-
# e.g. "/resources/en/*.json"
147
- source: "/options/locale/locale_en-US.ini"
15-
# Where translations will be placed
16-
# e.g. "/resources/%two_letters_code%/%original_file_name%"
17-
translation: "/options/locale/locale_%locale_with_underscore%.ini"
18-
# Files or directories for ignore
19-
# e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"]
20-
# ignore: []
21-
# The dest allows you to specify a file name in Crowdin
22-
# e.g. "/messages.json"
23-
# dest: ""
24-
# File type
25-
# e.g. "json"
8+
translation: "/options/locale/locale_%locale%.ini"
269
type: "ini"
27-
# The parameter "update_option" is optional. If it is not set, after the files update the translations for changed strings will be removed. Use to fix typos and for minor changes in the source strings
28-
# e.g. "update_as_unapproved" or "update_without_changes"
10+
skip_untranslated_strings: true
11+
export_only_approved: true
2912
update_option: "update_as_unapproved"

0 commit comments

Comments
 (0)