Skip to content

Commit ebf7419

Browse files
committed
New CI
1 parent 8b71412 commit ebf7419

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

.github/scripts/manage_translation.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,6 @@ def recreate_team_stats() -> None:
9494
fo.writelines(f"| {user} | {role} | {translators[user]} | {reviewers[user]} | {proofreaders[user]} |\n")
9595

9696

97-
def fetch_translations():
98-
"""Fetch translations from Transifex, remove source lines."""
99-
return_code = os.system(f'./tx pull -l {LANG} --force --skip')
100-
exit(return_code)
101-
102-
def format_translations():
103-
"""Format translations using 'msgcat' from 'gettext'"""
104-
return_code = os.system('find -name "*.po" -exec msgcat --no-location -o {} {} \;')
105-
exit(return_code)
106-
10797
if __name__ == "__main__":
10898
RUNNABLE_SCRIPTS = ('recreate_config', 'recreate_resource_stats', 'recreate_team_stats', 'fetch_translations', 'format_translations')
10999

.github/workflows/update-and-build.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,38 @@ jobs:
2424
with:
2525
python-version: 3
2626
- run: sudo apt-get install -y gettext
27-
- run: pip install transifex-python six
27+
- run: pip install transifex-python six sphinx-intl blurb
2828
- run: curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
2929
working-directory: /usr/local/bin
3030
- uses: actions/checkout@master
3131
with:
32+
repository: python/cpython
3233
ref: ${{ matrix.version }}
33-
- run: .github/scripts/manage_translation.py recreate_config
34+
path: cpython
35+
- run: make -C cpython/Doc/ gettext
36+
- run: sphinx-intl create-txconfig
37+
working-directory: cpython/Doc/build
38+
- run: sphinx-intl update-txconfig-resources --transifex-organization-name python-doc --transifex-project-name python-newest -d . -p gettext
39+
working-directory: cpython/Doc/build
3440
env:
3541
TX_TOKEN: ${{ secrets.TX_TOKEN }}
36-
- run: .github/scripts/manage_translation.py fetch_translations
42+
- run: tx pull -l uk --force --skip
43+
working-directory: cpython/Doc/build
3744
env:
3845
TX_TOKEN: ${{ secrets.TX_TOKEN }}
3946
- run: find -name "*.po" -exec msgcat --no-location -o {} {} \;
40-
- run: git config --local user.email github-actions@github.com
41-
- run: git config --local user.name "GitHub Action's update-translation job"
42-
- run: git add .
43-
- run: git commit -m 'Update translation from Transifex' || true
47+
working-directory: cpython/Doc/build
48+
- uses: actions/checkout@master
49+
with:
50+
ref: ${{ matrix.version }}
51+
path: python-docs-uk
52+
- run: cp -r cpython/Doc/build/uk/LC_MESSAGES/ python-docs-uk/.
53+
- run: |
54+
git config --local user.email github-actions@github.com
55+
git config --local user.name "GitHub Action's update-translation job"
56+
git add .
57+
git commit -m 'Update translation from Transifex' || true
58+
working-directory: cpython/Doc/build/uk/LC_MESSAGES
4459
- uses: ad-m/github-push-action@master
4560
with:
4661
branch: ${{ matrix.version }}

0 commit comments

Comments
 (0)