Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8065a17

Browse files
committed
Drop cpython checkout and change language dir
1 parent9f8bc49 commit8065a17

File tree

3 files changed

+22
-33
lines changed

3 files changed

+22
-33
lines changed

‎.github/workflows/sync.yml‎

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,22 @@ jobs:
3232
-name:Check out this repository
3333
uses:actions/checkout@v5
3434

35-
-name:Checkout CPython ${{ env.PYDOC_VERSION }}
36-
uses:actions/checkout@v5
37-
with:
38-
repository:'python/cpython'
39-
ref:${{ env.PYDOC_VERSION }}
40-
path:cpython
41-
4235
-name:Set language dir variable
4336
run:
44-
echo "LANGUAGE_DIR=cpython/Doc/locales/${{ env.PYDOC_LANGUAGE }}/LC_MESSAGES" >> $GITHUB_ENV
37+
echo "PYDOC_LANG_DIR=${{ env.PYDOC_VERSION }}" >> $GITHUB_ENV
4538

4639
-name:Checkout this repository ${{ env.PYDOC_VERSION }}
4740
uses:actions/checkout@v5
4841
with:
4942
ref:${{ env.PYDOC_VERSION }}
50-
path:${{ env.LANGUAGE_DIR }}
43+
path:${{ env.PYDOC_LANG_DIR }}
5144

5245
-uses:actions/setup-python@v6
5346
with:
5447
python-version:${{ inputs.version }}
5548
allow-prereleases:true
5649
cache:'pip'
57-
cache-dependency-path:|
58-
requirements.txt
59-
cpython/Doc/requirements.txt
60-
61-
-name:Check for Transifex API Token availability
62-
id:secret-check
63-
# perform secret check & put boolean result as an output
64-
shell:bash
65-
run:|
66-
available=false
67-
[[ "${{ secrets.TX_TOKEN }}" != '' ]] && available=true
68-
echo "available=$available" >> $GITHUB_OUTPUT
69-
echo "available=$available"
50+
cache-dependency-path:requirements.txt
7051

7152
# 2- Install dependencies
7253

@@ -81,19 +62,19 @@ jobs:
8162
-name:Install Python dependencies
8263
run:|
8364
pip install -r requirements.txt
84-
make -C cpython/Doc venv
8565
8666
# 3- Pull translations
8767

88-
-name:Generate template files and Transifex config file
89-
run:./scripts/generate_templates.sh
68+
-name:Generate updated .tx/config
69+
if:${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
70+
run:python scripts/generate_txconfig.py -p ./${{ env.PYDOC_LANG_DIR }} ${{ env.PYDOC_TX_PROJECT }}
9071

9172
-name:Pull translations from Transifex
9273
id:pull
9374
if:${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
9475
run:|
9576
# Clean up obsolete files
96-
find ./${{ env.LANGUAGE_DIR }} -name '*.po' -exec rm {} \;
77+
find ./${{ env.PYDOC_LANG_DIR }} -name '*.po' -exec rm {} \;
9778
./scripts/pull_translations.sh
9879
env:
9980
TX_TOKEN:${{ secrets.TX_TOKEN }}
@@ -103,26 +84,26 @@ jobs:
10384
run:|
10485
newer_branch=${PYDOC_VERSION%%.*}.$((${PYDOC_VERSION##*.}+1))
10586
git clone --depth 1 --single-branch --branch $newer_branch https://github.com/python/python-docs-pt-br ${newer_branch}-dir
106-
pomerge --from ./${newer_branch}-dir/{**/,}*.po --to ./${{ env.LANGUAGE_DIR }}/{**/,}*.po
87+
pomerge --from ./${newer_branch}-dir/{**/,}*.po --to ./${{ env.PYDOC_LANG_DIR }}/{**/,}*.po
10788
rm -rf ./${newer_branch}-dir
10889
10990
-name:powrap
11091
if:steps.pull.outcome == 'success'
11192
run:|
112-
cd ./${{ env.LANGUAGE_DIR }}
93+
cd ./${{ env.PYDOC_LANG_DIR }}
11394
powrap *.po **/*.po
11495
11596
-name:Update statistics
11697
if:always()
11798
run:|
11899
./scripts/stats.py
119-
git -C ./${{ env.LANGUAGE_DIR }} diff stats.json
100+
git -C ./${{ env.PYDOC_LANG_DIR }} diff stats.json
120101
121102
-name:Update potodo.md
122103
if:always()
123104
run:|
124105
./scripts/potodo.sh
125-
gitdiff ./${{ env.LANGUAGE_DIR }}/potodo.md
106+
git-C ./${{ env.PYDOC_LANG_DIR }} diffpotodo.md
126107
127108
# 4- Commit and push translations
128109

@@ -132,7 +113,7 @@ jobs:
132113
-name:Push
133114
if:${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
134115
run:|
135-
cd ./${{ env.LANGUAGE_DIR }}
116+
cd ./${{ env.PYDOC_LANG_DIR }}
136117
git push
137118
138119

‎scripts/commit.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55

66
set -eu
77

8+
test -n${PYDOC_LANGUAGE+x}
9+
810
rootdir=$(realpath$(dirname$0))
9-
cd$rootdir/../cpython/Doc/locales/${PYDOC_LANGUAGE}/LC_MESSAGES
11+
language_dir="${PYDOC_LANG_DIR:-$rootdir/../cpython/Doc/locales/${PYDOC_LANGUAGE}/LC_MESSAGES}"
12+
13+
cd"$language_dir"
1014

1115
extra_files=".tx/config stats.json potodo.md"
1216

‎scripts/pull_translations.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
set -xeu
2121

2222
test -n${PYDOC_TX_PROJECT+x}
23+
test -n${PYDOC_LANGUAGE+x}
2324

24-
cd"$(dirname$0)/../cpython/Doc/locales/${PYDOC_LANGUAGE}/LC_MESSAGES/"
25+
rootdir=$(realpath$(dirname$0))
26+
language_dir="${PYDOC_LANG_DIR:-$rootdir/../cpython/Doc/locales/${PYDOC_LANGUAGE}/LC_MESSAGES}"
27+
28+
cd"$language_dir"
2529

2630
# If a PO file is provided as input, convert it into Transifex resource
2731
# and add it be pulled (instead of pulling all translations files).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp