Skip to content
Merged
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
feat(workflows/crowdin): restore po files which only have change in `…
…PO-Revision-Date`
  • Loading branch information
LaoSparrow committed Jan 10, 2025
commit 32db56af5fa7c452ffa6f26d2a5ab0f19d4d7cd2
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,12 @@ jobs:
upload_sources: true
upload_translations: false

skip_untranslated_files: true
download_sources: false
download_translations: false

localization_branch_name: 'i18n-tmp'
commit_message: 'New Crowdin translations [skip actions]'
push_translations: false
push_sources: false

create_pull_request: false
env:
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
GITHUB_TOKEN: ${{ secrets.CROWDIN_GH_TOKEN }}

# Visit https://crowdin.com/settings#api-key to create this token
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
44 changes: 31 additions & 13 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Crowdin Action
name: Crowdin Sync

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
Expand All @@ -15,28 +19,42 @@ jobs:
submodules: 'recursive'
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: crowdin action
- name: Crowdin upload sources and download translations
uses: crowdin/github-action@v2
with:
crowdin_branch_name: 'master'

upload_sources: true
upload_translations: false

download_sources: false
download_translations: true
skip_untranslated_files: true

localization_branch_name: 'i18n-tmp'
commit_message: 'New Crowdin translations [skip actions]'
push_sources: false
push_translations: false

create_pull_request: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'New Crowdin pull request with translations'
pull_request_base_branch_name: 'master'
create_pull_request: false
env:
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
GITHUB_TOKEN: ${{ secrets.CROWDIN_GH_TOKEN }}

# Visit https://crowdin.com/settings#api-key to create this token
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

- name: Process translation files
shell: pwsh
run: |
foreach ($p in @(git diff --numstat)) {
if (!$p.EndsWith(".po")) { continue }
$d = -split $p
if ([int]$d[0] -le 1 -and [int]$d[1] -le 1) {
git checkout $d[2]
}
}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'New Crowdin translations [skip actions]'
committer: 'Crowdin Bot <support+bot@crowdin.com>'
title: 'New Crowdin Translations'
body: 'New Crowdin pull request with translations'
branch: 'i18n-tmp'
base: 'master'