Skip to content

Commit

Permalink
add crowdin workflows and update crowdin.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ckscor3 committed May 21, 2024
1 parent c05c32b commit f08d415
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/crowdin-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Crowdin Pull Request

on:
schedule:
- cron: '0 */1 * * *' # Every hour - https://crontab.guru/#0_*/1_*_*_*

permissions:
contents: write
pull-requests: write

jobs:
crowdin-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Synchronize with Crowdin
uses: crowdin/github-action@v1
with:
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: 'l10n_1.20.4'

create_pull_request: true
pull_request_title: 'Update translations from Crowdin'
pull_request_body: ''
pull_request_base_branch_name: '1.20.4'
commit_message: 'Update translations from Crowdin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/crowdin-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Crowdin Upload

on:
push:
branches:
- '1.20.4'
paths:
- '**/lang/**'

jobs:
crowdin-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Crowdin push
uses: crowdin/github-action@v1
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 }}
14 changes: 11 additions & 3 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
files:
- source: /**/lang/en_us.json
translation: /**/lang/%locale_with_underscore%.json
"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": "/**/lang/en_us.json",
"translation": "/**/lang/%locale_with_underscore%.json",
}
]

0 comments on commit f08d415

Please sign in to comment.