Skip to content

Commit 5164b8d

Browse files
committed
Add transifex pull and push gh workflows
1 parent c5afb06 commit 5164b8d

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 🌎 Pull translations
2+
3+
# TODO: uncomment this since when workflow is finalized
4+
# on:
5+
# schedule:
6+
# - cron: "5 1 * * *"
7+
# workflow_dispatch:
8+
9+
# TODO: remove following `on` config when workflow is finalized
10+
on:
11+
push:
12+
paths:
13+
- 'docker-app/qfieldcloud/locale/**'
14+
- '.github/workflows/translations_pull.yml'
15+
16+
jobs:
17+
build:
18+
name: Pull translations
19+
runs-on: ubuntu-latest
20+
21+
env:
22+
TX_TOKEN: ${{ secrets.TX_TOKEN }}
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Install Transifex CLI
29+
run: |
30+
curl -OL https://github.com/transifex/cli/releases/download/v1.6.17/tx-linux-amd64.tar.gz
31+
tar -xvzf tx-linux-amd64.tar.gz
32+
33+
- name: Pull from Transifex
34+
run: ./tx pull -a --minimum-perc=50 --force
35+
36+
# temporary
37+
- name: Show pulled translation
38+
run: cat docker-app/qfieldcloud/locale/es/LC_MESSAGES/django.po
39+
40+
# TODO: uncomment this block when workflow is finalized
41+
# - name: Add and commit new translations
42+
# uses: EndBug/add-and-commit@v9
43+
# with:
44+
# message: Synchronize translations
45+
# author_name: Translation update 💬
46+
# author_email: [email protected]
47+
# add: '["docker-app/qfieldcloud/locale"]'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 🌎 Update translations
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'docker-app/qfieldcloud/locale/**'
9+
- '.github/workflows/translations_push.yml'
10+
jobs:
11+
build:
12+
name: Update translations
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
TX_TOKEN: ${{ secrets.TX_TOKEN }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Transifex CLI
23+
run: |
24+
curl -OL https://github.com/transifex/cli/releases/download/v1.6.17/tx-linux-amd64.tar.gz
25+
tar -xvzf tx-linux-amd64.tar.gz
26+
27+
- name: Translate
28+
run: docker compose run --rm --user root app python manage.py makemessages -l es
29+
30+
- name: Push to Transifex
31+
run: ./tx push --source

0 commit comments

Comments
 (0)