Skip to content

Commit 850dcc4

Browse files
Fix workflow and translation problems (#58)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 2fcdffb commit 850dcc4

541 files changed

Lines changed: 42661 additions & 247663 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/sync-with-cpython.yml

Lines changed: 10 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ concurrency:
2121
jobs:
2222
sync:
2323
runs-on: ubuntu-latest
24+
env:
25+
CPYTHON_TAG: ${{ github.event.inputs.cpython_tag || 'v3.14.7' }}
2426
steps:
2527
- name: Checkout translation repo
2628
uses: actions/checkout@v4
@@ -38,41 +40,12 @@ jobs:
3840
- name: Install Python dependencies
3941
run: pip install sphinx sphinx-intl
4042

41-
- name: Checkout CPython docs only (sparse)
42-
run: |
43-
git clone \
44-
--depth 1 \
45-
--filter=blob:none \
46-
--sparse \
47-
--branch ${{ github.event.inputs.cpython_tag || 'v3.14.7' }} \
48-
https://github.com/python/cpython.git \
49-
.cpython-src
50-
cd .cpython-src
51-
git sparse-checkout set Doc Include
52-
53-
- name: Install CPython doc dependencies
54-
run: |
55-
python -m venv .cpython-src/Doc/venv
56-
.cpython-src/Doc/venv/bin/pip install \
57-
-r .cpython-src/Doc/requirements.txt
58-
59-
- name: Build .pot templates
60-
run: |
61-
cd .cpython-src/Doc
62-
./venv/bin/sphinx-build \
63-
-b gettext \
64-
. \
65-
../../.pot-templates
66-
67-
- name: Merge .pot into .po files
68-
run: |
69-
find .pot-templates -name "*.pot" | while read f; do
70-
rel="${f#.pot-templates/}"
71-
po="${rel%.pot}.po"
72-
if [ -f "$po" ]; then
73-
msgmerge --update --backup=off --no-location --no-wrap "$po" "$f"
74-
fi
75-
done
43+
# Item 4: fetch/build/merge/validate now all live in one shared
44+
# module (scripts/po_sync.py) instead of inline bash/awk here, so
45+
# this workflow can't drift from update_python_version.py the way
46+
# it did before (missing --no-location --no-wrap on one side).
47+
- name: Sync msgids (fetch, build gettext, merge, validate)
48+
run: python scripts/po_sync.py sync-only "$CPYTHON_TAG"
7649

7750
- name: Ensure translation label exists
7851
env:
@@ -87,7 +60,6 @@ jobs:
8760
- name: Open issue for fuzzy strings
8861
env:
8962
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90-
CPYTHON_TAG: ${{ github.event.inputs.cpython_tag || 'v3.14.7' }}
9163
run: |
9264
tmpfile=$(mktemp)
9365
while IFS= read -r f; do
@@ -130,41 +102,11 @@ jobs:
130102
fi
131103
rm -f "$tmpfile"
132104
133-
- name: Validate .po files
134-
run: |
135-
tmpfile=$(mktemp)
136-
find . -name "*.po" \
137-
-not -path "./.git/*" \
138-
-not -path "./.cpython-src/*" \
139-
-not -path "./.pot-templates/*" | while read f; do
140-
msgfmt --check "$f" -o /dev/null || echo "FAIL: $f" >> "$tmpfile"
141-
done
142-
if [ -s "$tmpfile" ]; then
143-
cat "$tmpfile"
144-
rm -f "$tmpfile"
145-
exit 1
146-
fi
147-
rm -f "$tmpfile"
148-
149-
- name: Clean up scratch files
150-
run: rm -rf .cpython-src .pot-templates
151-
152105
- name: Stage changes
153106
run: git add --all
154107

155108
- name: Unstage POT-Creation-Date-only changes
156-
run: |
157-
git diff --staged --name-only | while read f; do
158-
if git diff --staged -U0 -- "$f" \
159-
| grep '^[+-]' \
160-
| grep -v '^[+-][+-][+-]' \
161-
| grep -qv 'POT-Creation-Date'; then
162-
: # has real changes, keep staged
163-
else
164-
git restore --staged "$f"
165-
git restore "$f"
166-
fi
167-
done
109+
run: python scripts/unstage_cosmetic.py
168110

169111
- name: Commit if changed
170112
run: |
@@ -174,6 +116,5 @@ jobs:
174116
echo "Nothing to commit, skipping."
175117
exit 0
176118
fi
177-
git commit -m \
178-
"chore: sync msgids with CPython ${{ github.event.inputs.cpython_tag || 'v3.14.7' }}"
119+
git commit -m "chore: sync msgids with CPython $CPYTHON_TAG"
179120
git push

about.po

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ msgid ""
1414
msgstr ""
1515
"Project-Id-Version: Python 3.14\n"
1616
"Report-Msgid-Bugs-To: \n"
17-
"POT-Creation-Date: 2026-08-25 20:39+0330\n"
17+
"POT-Creation-Date: 2026-08-26 03:59+0000\n"
1818
"PO-Revision-Date: 2021-06-28 00:47+0000\n"
1919
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
2020
"Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n"
@@ -24,78 +24,32 @@ msgstr ""
2424
"Content-Transfer-Encoding: 8bit\n"
2525
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
2626

27-
#: ../../about.rst:3
2827
msgid "About this documentation"
2928
msgstr "دربارهٔ این مستندات"
3029

31-
#: ../../about.rst:6
32-
msgid ""
33-
"Python's documentation is generated from `reStructuredText`_ sources using "
34-
"`Sphinx`_, a documentation generator originally created for Python and now "
35-
"maintained as an independent project."
36-
msgstr ""
37-
"مستندات پایتون از طریق منابع `reStructuredText`_ با استفاده از `Sphinx`_ "
38-
"تولید می‌شوند، که یک تولیدگر مستندات است که در ابتدا برای پایتون ساخته شد و "
39-
"اکنون به‌عنوان یک پروژه مستقل نگهداری می‌شود."
30+
msgid "Python's documentation is generated from `reStructuredText`_ sources using `Sphinx`_, a documentation generator originally created for Python and now maintained as an independent project."
31+
msgstr "مستندات پایتون از طریق منابع `reStructuredText`_ با استفاده از `Sphinx`_ تولید می‌شوند، که یک تولیدگر مستندات است که در ابتدا برای پایتون ساخته شد و اکنون به‌عنوان یک پروژه مستقل نگهداری می‌شود."
4032

41-
#: ../../about.rst:16
42-
msgid ""
43-
"Development of the documentation and its toolchain is an entirely volunteer "
44-
"effort, just like Python itself. If you want to contribute, please take a "
45-
"look at the :ref:`reporting-bugs` page for information on how to do so. New "
46-
"volunteers are always welcome!"
47-
msgstr ""
48-
"توسعهٔ مستندات و زنجیرهٔ ابزارهایش، همانند خود پایتون تلاشی کاملاً داوطلبانه "
49-
"است. اگر می‌خواهید مشارکت کنید برای اطّلاعات در مورد چگونگی آن نگاهی به "
50-
"صفحهٔ :ref:`reporting-bugs` بیندازید. همیشه از داوطلبان جدید استقبال می‌شود!"
33+
msgid "Development of the documentation and its toolchain is an entirely volunteer effort, just like Python itself. If you want to contribute, please take a look at the :ref:`reporting-bugs` page for information on how to do so. New volunteers are always welcome!"
34+
msgstr "توسعهٔ مستندات و زنجیرهٔ ابزارهایش، همانند خود پایتون تلاشی کاملاً داوطلبانه است. اگر می‌خواهید مشارکت کنید برای اطّلاعات در مورد چگونگی آن نگاهی به صفحهٔ :ref:`reporting-bugs` بیندازید. همیشه از داوطلبان جدید استقبال می‌شود!"
5135

52-
#: ../../about.rst:21
5336
msgid "Many thanks go to:"
5437
msgstr "سپاس بسیار از:"
5538

56-
#: ../../about.rst:23
57-
msgid ""
58-
"Fred L. Drake, Jr., the creator of the original Python documentation toolset "
59-
"and author of much of the content;"
60-
msgstr ""
61-
"فرد ال. درک جونیور خالق مجموعه ابزارهای اصلی مستندات پایتون و نویسنده بسیاری "
62-
"از محتواها:"
39+
msgid "Fred L. Drake, Jr., the creator of the original Python documentation toolset and author of much of the content;"
40+
msgstr "فرد ال. درک جونیور خالق مجموعه ابزارهای اصلی مستندات پایتون و نویسنده بسیاری از محتواها:"
6341

64-
#: ../../about.rst:25
65-
msgid ""
66-
"the `Docutils <https://docutils.sourceforge.io/>`_ project for creating "
67-
"reStructuredText and the Docutils suite;"
68-
msgstr ""
69-
"پروژه `Docutils <https://docutils.sourceforge.io/>`_ برای ایجاد "
70-
"reStructuredText و مجموعهٔ Docutils؛"
42+
msgid "the `Docutils <https://docutils.sourceforge.io/>`_ project for creating reStructuredText and the Docutils suite;"
43+
msgstr "پروژه `Docutils <https://docutils.sourceforge.io/>`_ برای ایجاد reStructuredText و مجموعهٔ Docutils؛"
7144

72-
#: ../../about.rst:27
73-
msgid ""
74-
"Fredrik Lundh for his Alternative Python Reference project from which Sphinx "
75-
"got many good ideas."
76-
msgstr ""
77-
"فردریک لوند (Fredrik Lundh) برای پروژه‌ی \"Alternative Python Reference\" "
78-
"(مرجع جایگزین پایتون) که از آن بسیاری از ایده‌های خوب برای Sphinx (اسفینکس) "
79-
"گرفته شد."
45+
msgid "Fredrik Lundh for his Alternative Python Reference project from which Sphinx got many good ideas."
46+
msgstr "فردریک لوند (Fredrik Lundh) برای پروژه‌ی \"Alternative Python Reference\" (مرجع جایگزین پایتون) که از آن بسیاری از ایده‌های خوب برای Sphinx (اسفینکس) گرفته شد."
8047

81-
#: ../../about.rst:32
8248
msgid "Contributors to the Python documentation"
8349
msgstr "مشارکت کنندگان مستندات پایتون"
8450

85-
#: ../../about.rst:34
86-
msgid ""
87-
"Many people have contributed to the Python language, the Python standard "
88-
"library, and the Python documentation. See :source:`Misc/ACKS` in the "
89-
"Python source distribution for a partial list of contributors."
90-
msgstr ""
91-
"افراد زیادی در توسعه زبان پایتون، کتابخانه استاندارد پایتون، و مستندات "
92-
"پایتون مشارکت داشته‌اند. برای مشاهده فهرستی از برخی از این مشارکت‌کنندگان، "
93-
"به :source:`Misc/ACKS` در توزیع سورس پایتون مراجعه کنید."
51+
msgid "Many people have contributed to the Python language, the Python standard library, and the Python documentation. See :source:`Misc/ACKS` in the Python source distribution for a partial list of contributors."
52+
msgstr "افراد زیادی در توسعه زبان پایتون، کتابخانه استاندارد پایتون، و مستندات پایتون مشارکت داشته‌اند. برای مشاهده فهرستی از برخی از این مشارکت‌کنندگان، به :source:`Misc/ACKS` در توزیع سورس پایتون مراجعه کنید."
9453

95-
#: ../../about.rst:38
96-
msgid ""
97-
"It is only with the input and contributions of the Python community that "
98-
"Python has such wonderful documentation -- Thank You!"
99-
msgstr ""
100-
"فقط با مشارکت‌ها و کمک‌های جامعه پایتون است که پایتون چنین مستندات فوق‌العاده‌ای "
101-
"دارد -- سپاس از شما!"
54+
msgid "It is only with the input and contributions of the Python community that Python has such wonderful documentation -- Thank You!"
55+
msgstr "فقط با مشارکت‌ها و کمک‌های جامعه پایتون است که پایتون چنین مستندات فوق‌العاده‌ای دارد -- سپاس از شما!"

0 commit comments

Comments
 (0)