Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Crowdin #8503

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/crowdin-download-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Crowdin Download Translations

on:
schedule:
- cron: '0 0 * * *' # Every day at 00:00 UTC
workflow_dispatch:

permissions:
contents: read
pull-requests: write

jobs:
download-translations:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin pull
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'This PR contains new translations from Crowdin.'
pull_request_base_branch_name: 'develop'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/crowdin-upload-source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Crowdin Upload Source

on:
push:
paths: [ '/src/Locale/**' ]
branches: [ develop ]

jobs:
upload-sources:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin push
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: true
download_translations: false
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
15 changes: 12 additions & 3 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
files:
- source: /src/Locale/en/*.json
translation: /src/Locale/%two_letters_code%/%original_file_name%
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."
"base_url": "https://api.crowdin.com"
"preserve_hierarchy": true

files: [
{
"source": "/src/Locale/en/*.json",
"translation": "/src/Locale/%two_letters_code%/%original_file_name%",
}
]
Loading