Add CI job for translations

This commit is contained in:
Gabe Kangas 2023-11-27 22:21:46 -08:00
parent 1c8b9d0728
commit 8497c3f60b
3 changed files with 38 additions and 3 deletions

28
.github/workflows/translations.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Crowdin Action
on:
push:
branches: [translations]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
download_translations: true
localization_branch_name: translations
config: crowdin.yml
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

10
crowdin.yml Normal file
View File

@ -0,0 +1,10 @@
'pull_request_title': 'Translations update: %two_letters_code%'
'pull_request_labels': ['crowdin', 'l10n']
'commit_message': 'Updated translations for %two_letters_code%'
files:
- source: web/i18n/*.json
translation: web/i18n/%original_file_name%
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN

View File

@ -1,3 +0,0 @@
files:
- source: /translations/locales/en-us.po
translation: /translations/locales/%locale%.po