Skip to content

Commit 1fa4a8b

Browse files
authored
Add GitHub Actions workflow for Transifex translations
1 parent 5c32cc8 commit 1fa4a8b

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Push Translations to Transifex
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Python documentation version"
8+
required: true
9+
type: choice
10+
options:
11+
- "3.13"
12+
- "3.14"
13+
- "3.15"
14+
default: "3.15"
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
push-translations:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
ref: ${{ inputs.version }}
27+
fetch-depth: 0
28+
29+
- uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.x"
32+
33+
- name: Install Dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y gettext
37+
pip install requests cogapp polib transifex-python sphinx-intl blurb six
38+
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
39+
working-directory: /usr/local/bin
40+
41+
- name: Recreate Transifex configuration
42+
run: |
43+
curl -O https://raw.githubusercontent.com/python-docs-translations/transifex-automations/master/sample-workflows/transifex-util.py
44+
chmod +x transifex-util.py
45+
./transifex-util.py recreate_tx_config \
46+
--language pa \
47+
--project-slug python-newest \
48+
--version ${{ inputs.version }}
49+
env:
50+
TX_TOKEN: ${{ secrets.TX_TOKEN }}
51+
52+
- name: Push translations to Transifex
53+
run: tx push -t
54+
env:
55+
TX_TOKEN: ${{ secrets.TX_TOKEN }}

0 commit comments

Comments
 (0)