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

Create Crowdin GitHub Action #488

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions .github/workflows/crowdin_pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Update translations

on:
schedule:
- cron: "*/10 * * * *"

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/Checkout@v3
- name: Pull latest translations
uses: crowdin/github-action@1.4.9
with:
upload_translations: false
download_translations: true
crowdin_branch_name: "github"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/crowdin_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Push to Crowdin

on:
push:
branches:
- "master"
paths:
- "src/main/resources/lang/en.json"
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Push to Crowdin
uses: crowdin/github-action@1.4.9
with:
upload_translations: true
download_translations: false
crowdin_branch_name: "github"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}

10 changes: 8 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
commit_message: "Update %language%"
project_id_env: CROWDIN_ID
api_token_env: CROWDIN_TOKEN

skip_untranslated_files: true

append_commit_message: false
commit_message: "Update latest translations"

files:
- source: src/main/resources/lang/en.json
translation: /src/main/resources/lang/%locale%.%file_extension%
translation: /src/main/resources/lang/%locale%.json