mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:47:20 +08:00
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
name: L10n
|
|
on:
|
|
workflow_dispatch:
|
|
concurrency:
|
|
group: l10n
|
|
cancel-in-progress: true
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
jobs:
|
|
l10n:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
run_install: true
|
|
package_json_file: web/package.json
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: 'pnpm'
|
|
cache-dependency-path: web/pnpm-lock.yaml
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
cache: true
|
|
go-version: 'stable'
|
|
- name: Install xgotext
|
|
run: |
|
|
go install github.com/leonelquinteros/gotext/cli/xgotext@latest
|
|
- name: Generate pot files
|
|
run: |
|
|
~/go/bin/xgotext -default backend -pkg-tree ./cmd/web -out ./pkg/embed/locales
|
|
cd web && pnpm run gettext:extract
|
|
- uses: stefanzweifel/git-auto-commit-action@v6
|
|
name: Commit changes
|
|
with:
|
|
commit_message: "chore(l10n): update pot files"
|
|
- name: Sync with Crowdin
|
|
uses: crowdin/github-action@v2
|
|
with:
|
|
config: crowdin.yml
|
|
upload_sources: true
|
|
upload_translations: false
|
|
download_translations: true
|
|
export_only_approved: true
|
|
create_pull_request: true
|
|
pull_request_title: 'l10n: sync translations with Crowdin'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|