-
Notifications
You must be signed in to change notification settings - Fork 10
60 lines (50 loc) · 1.78 KB
/
Copy pathsync.yml
File metadata and controls
60 lines (50 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: "Sync Translations"
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight
workflow_dispatch: # Allow manual triggers
pull_request:
types: [labeled] # Trigger on PR label
permissions:
contents: write
pull-requests: write
jobs:
sync-translations:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || github.event.label.name == 'sync-translations'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Transifex CLI
run: |
cd /usr/local/bin
sudo curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gettext
pip install transifex-python sphinx-intl
- name: Sync with Transifex
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: |
# Pull reviewed translations from Transifex
tx pull -f -l fa --mode=reviewed
# Format .po files
find . -name "*.po" -exec msgcat --no-wrap {} -o {} \;
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update Farsi translations from Transifex"
title: "Sync translations from Transifex"
body: |
This PR updates Persian (fa) translations from Transifex.
- Pulls reviewed translations only
- Auto-generated by GitHub Actions
branch: update-translations
delete-branch: true