ci: Add crowdin github actions

This commit is contained in:
Nathan Adams 2023-05-16 19:47:09 +02:00
parent 56afce2e3a
commit e44ff69be4
3 changed files with 58 additions and 8 deletions

View File

@ -0,0 +1,33 @@
name: Download translations from Crowdin
on:
schedule:
- cron: '0 21 * * *'
jobs:
crowdin:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Crowdin push
uses: crowdin/github-action@v1
with:
config: 'crowdin.yml'
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_title: 'chore: Update translations'
pull_request_body: 'New Crowdin pull request with translations'
pull_request_labels: 'localization'
pull_request_base_branch_name: 'master'
commit_message: 'chore: Update translations from Crowdin'
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

24
.github/workflows/upload_texts.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Upload source texts to Crowdin
on:
push:
branches: [ master ]
jobs:
crowdin:
runs-on: ubuntu-latest
strategy:
max-parallel: 1 # Should be 1 to avoid parallel builds
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Crowdin push
uses: crowdin/github-action@v1
with:
config: 'crowdin.yml'
upload_sources: true
upload_translations: false
download_translations: false
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View File

@ -1,17 +1,10 @@
# To use the crowdin-cli, set an access token in CROWDIN_PERSONAL_TOKEN or a ~/.crowdin.yml
# File structure documentation can be found at: https://developer.crowdin.com/configuration-file/
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"project_id": 582621 # This is https://crowdin.com/project/ruffle
"preserve_hierarchy": true # Keep the directory structure so that we know, for example, "messages.json" belongs to the extension
# Github integration
"pull_request_title": "Update text translations"
"pull_request_labels": [
"localization"
]
"commit_message": "chore: Updates translations in %original_file_name% from Crowdin"
"append_commit_message": false
# Files we want to translate
"files": [
{