mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 02:26:33 +00:00
ci: crowdin actions (#58447)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
50
.github/workflows/crowdin-actions-download-translations.yml
vendored
Normal file
50
.github/workflows/crowdin-actions-download-translations.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
name: Download translations from Crowdin
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 4 * * 1"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: crowdin-download
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
download-translations:
|
||||||
|
name: Download translations into ${{ matrix.branch }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
branch: ["develop", "version-16-hotfix"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout ${{ matrix.branch }}
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
ref: ${{ matrix.branch }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Download translations and open PR
|
||||||
|
uses: crowdin/github-action@8f01d54f70f1713ee3f09d82c2bbb2daeac28689 # v2.17.1
|
||||||
|
with:
|
||||||
|
config: crowdin.yml
|
||||||
|
upload_sources: false
|
||||||
|
upload_translations: false
|
||||||
|
download_translations: true
|
||||||
|
crowdin_branch_name: ${{ matrix.branch }}
|
||||||
|
skip_ref_checkout: true
|
||||||
|
localization_branch_name: l10n_crowdin_${{ matrix.branch }}
|
||||||
|
create_pull_request: true
|
||||||
|
pull_request_base_branch_name: ${{ matrix.branch }}
|
||||||
|
commit_message: "fix: sync translations from crowdin"
|
||||||
|
pull_request_title: "fix: sync translations from crowdin (${{ matrix.branch }})"
|
||||||
|
pull_request_labels: "translation, skip-release-notes"
|
||||||
|
pull_request_reviewers: barredterra
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||||
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||||
54
.github/workflows/crowdin-actions-update-main-pot.yml
vendored
Normal file
54
.github/workflows/crowdin-actions-update-main-pot.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: Upload main.pot to Crowdin
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
- version-16-hotfix
|
||||||
|
paths:
|
||||||
|
- "erpnext/locale/main.pot"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: crowdin-upload-${{ github.ref_name }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload-sources:
|
||||||
|
name: Upload sources from ${{ github.ref_name }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout ${{ github.ref_name }}
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Restore Crowdin cache
|
||||||
|
uses: actions/cache/restore@v6
|
||||||
|
with:
|
||||||
|
path: .crowdin
|
||||||
|
key: crowdin-${{ github.ref_name }}
|
||||||
|
restore-keys: crowdin-${{ github.ref_name }}-
|
||||||
|
|
||||||
|
- name: Upload main.pot to Crowdin
|
||||||
|
uses: crowdin/github-action@8f01d54f70f1713ee3f09d82c2bbb2daeac28689 # v2.17.1
|
||||||
|
with:
|
||||||
|
config: crowdin.yml
|
||||||
|
upload_sources: true
|
||||||
|
upload_translations: false
|
||||||
|
download_translations: false
|
||||||
|
create_pull_request: false
|
||||||
|
crowdin_branch_name: ${{ github.ref_name }}
|
||||||
|
upload_sources_args: "--cache"
|
||||||
|
env:
|
||||||
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||||
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||||
|
|
||||||
|
- name: Save Crowdin cache
|
||||||
|
uses: actions/cache/save@v6
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
path: .crowdin
|
||||||
|
key: crowdin-${{ github.ref_name }}-${{ github.run_id }}
|
||||||
13
crowdin.yml
13
crowdin.yml
@@ -1,16 +1,3 @@
|
|||||||
files:
|
files:
|
||||||
- source: /erpnext/locale/main.pot
|
- source: /erpnext/locale/main.pot
|
||||||
translation: /erpnext/locale/%two_letters_code%.po
|
translation: /erpnext/locale/%two_letters_code%.po
|
||||||
pull_request_title: "fix: sync translations from crowdin"
|
|
||||||
pull_request_labels:
|
|
||||||
- translation
|
|
||||||
- skip-release-notes
|
|
||||||
pull_request_reviewers:
|
|
||||||
- barredterra # change to your GitHub username if you copied this file
|
|
||||||
commit_message: "fix: %language% translations"
|
|
||||||
append_commit_message: false
|
|
||||||
languages_mapping:
|
|
||||||
two_letters_code:
|
|
||||||
pt-BR: pt_BR
|
|
||||||
zh-CN: zh
|
|
||||||
zh-TW: zh_TW
|
|
||||||
|
|||||||
Reference in New Issue
Block a user