Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 11 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,21 @@ jobs:
uses: actions/checkout@v4
with:
path: Doc/locales/fa/LC_MESSAGES


- name: Install gettext
run: sudo apt-get install -y gettext

- name: Compile .po files to .mo
run: |
find Doc/locales/fa/LC_MESSAGES -name "*.po" | while read f; do
msgfmt "$f" -o "${f%.po}.mo"
done

- name: Setup problem matcher
uses: sphinx-doc/github-problem-matcher@v1.1

- name: Build documentation
run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 -W --keep-going" html
run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 --keep-going" html
working-directory: ./Doc

- name: Setup Pages
Expand Down
164 changes: 164 additions & 0 deletions .github/workflows/sync-with-cpython.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Sync with CPython

on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
inputs:
cpython_tag:
description: 'CPython tag to sync against (e.g. v3.14.6)'
required: false
default: 'v3.14.6'

permissions:
contents: write
issues: write

concurrency:
group: sync
cancel-in-progress: false

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout translation repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install gettext
run: sudo apt-get install -y gettext

- name: Install Python dependencies
run: pip install sphinx sphinx-intl

- name: Checkout CPython docs only (sparse)
run: |
git clone \
--depth 1 \
--filter=blob:none \
--sparse \
--branch ${{ github.event.inputs.cpython_tag || 'v3.14.6' }} \
https://github.com/python/cpython.git \
.cpython-src
cd .cpython-src
git sparse-checkout set Doc Include

- name: Install CPython doc dependencies
run: |
python -m venv .cpython-src/Doc/venv
.cpython-src/Doc/venv/bin/pip install \
-r .cpython-src/Doc/requirements.txt

- name: Build .pot templates
run: |
cd .cpython-src/Doc
./venv/bin/sphinx-build \
-b gettext \
. \
../../.pot-templates

- name: Merge .pot into .po files
run: |
find .pot-templates -name "*.pot" | while read f; do
rel="${f#.pot-templates/}"
po="${rel%.pot}.po"
if [ -f "$po" ]; then
msgmerge --update --backup=off --no-location "$po" "$f"
fi
done

- name: Ensure translation label exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh label create "translation" \
--color "0075ca" \
--description "Translation review needed" \
--repo ${{ github.repository }} \
2>/dev/null || true

- name: Open issue for fuzzy strings
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CPYTHON_TAG: ${{ github.event.inputs.cpython_tag || 'v3.14.6' }}
run: |
tmpfile=$(mktemp)
while IFS= read -r f; do
fuzzy=$(msgattrib --only-fuzzy --no-obsolete "$f" 2>/dev/null)
if [ -n "$fuzzy" ]; then
entries=$(echo "$fuzzy" | awk '
/^msgid / {
first=$0; msg=$0"\n"; lines=1; incapture=1; next
}
incapture && /^"/ {
msg = msg $0 "\n"; lines++; next
}
incapture && /^msgstr/ {
incapture=0
if (!(first == "msgid \"\"" && lines==1)) {
printf "- %s\n", msg
}
next
}
')
count=$(echo "$entries" | grep -c '^- ' || echo 0)
if [ "$count" -gt 0 ]; then
echo "### $f ($count fuzzy)" >> "$tmpfile"
echo "$entries" | head -20 >> "$tmpfile"
echo "" >> "$tmpfile"
fi
fi
done < <(find . -name "*.po" \
-not -path "./.git/*" \
-not -path "./.cpython-src/*" \
-not -path "./.pot-templates/*")
if [ -s "$tmpfile" ]; then
gh issue create \
--title "🔍 Fuzzy strings need review after CPython sync ($(date +%Y-%m-%d))" \
--body "$(cat "$tmpfile")

Triggered by sync with \`$CPYTHON_TAG\`." \
--label "translation" \
--repo ${{ github.repository }}
fi
rm -f "$tmpfile"

- name: Validate .po files
run: |
tmpfile=$(mktemp)
find . -name "*.po" \
-not -path "./.git/*" \
-not -path "./.cpython-src/*" \
-not -path "./.pot-templates/*" | while read f; do
msgfmt --check "$f" -o /dev/null || echo "FAIL: $f" >> "$tmpfile"
done
if [ -s "$tmpfile" ]; then
cat "$tmpfile"
rm -f "$tmpfile"
exit 1
fi
rm -f "$tmpfile"

- name: Clean up scratch files
run: rm -rf .cpython-src .pot-templates

- name: Commit if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add --all
git diff --staged -U0 \
| grep '^[+-]' \
| grep -v '^[+-][+-][+-]' \
| grep -qv 'POT-Creation-Date' \
|| { echo "Only POT-Creation-Date changed, skipping commit."; exit 0; }
git commit -m \
"chore: sync msgids with CPython ${{ github.event.inputs.cpython_tag || 'v3.14.6' }}"
git push
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ python3 scripts/translation_status.py --only-incomplete
<!-- STATS_START -->
### مشارکت‌های کاربران
![نمودار مشارکت‌های کاربران؛ Revisto 3984، sepehr-rs 1630، danialbehzadi 677، invincible627 358، khosro_o 63، ParhamF 41، Ariyan_Bolandi 37، nikovinix7878 13، thaghgoo 12، Ramiz_222 10](reports/contributor_stats_latest.png)
(به‌روزرسانی: 2026-08-15)
(به‌روزرسانی: 2026-08-16)
<!-- STATS_END -->
2 changes: 1 addition & 1 deletion STATUS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- TRANSLATION_STATUS_START -->
### وضعیت ترجمه فایل‌ها
(به‌روزرسانی: 2026-08-15)
(به‌روزرسانی: 2026-08-16)

| File | Translated | Fuzzy |
|:-----|:-----------:|:-----------:|
Expand Down
29 changes: 9 additions & 20 deletions about.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-25 12:59+0330\n"
"POT-Creation-Date: 2026-08-16 08:01+0000\n"
"PO-Revision-Date: 2021-06-28 00:47+0000\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/revisto/python-docs-fa/"
"fa/)\n"
"Language-Team: Persian (https://github.com/revisto/python-docs-fa/fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

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

#: ../../about.rst:6
msgid ""
"Python's documentation is generated from `reStructuredText`_ sources using "
"`Sphinx`_, a documentation generator originally created for Python and now "
Expand All @@ -39,61 +36,53 @@ msgstr ""
"تولید می‌شوند، که یک تولیدکننده مستندات است که در ابتدا برای پایتون ساخته شد "
"و اکنون به‌عنوان یک پروژه مستقل نگهداری می‌شود."

#: ../../about.rst:16
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!"
msgstr ""
"توسعهٔ مستندات و زنجیرهٔ ابزارهایش، همانند خود پایتون تلاشی کاملاً داوطلبانه "
"است. اگر می‌خواهید مشارکت کنید برای اطّلاعات در مورد چگونگی آن نگاهی به "
"صفحهٔ :ref:`reporting-bugs` بیندازید. همیشه از داوطلبان جدید استقبال می‌شود!"
"است. اگر می‌خواهید مشارکت کنید برای اطّلاعات در مورد چگونگی آن نگاهی به صفحهٔ :"
"ref:`reporting-bugs` بیندازید. همیشه از داوطلبان جدید استقبال می‌شود!"

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

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

#: ../../about.rst:25
msgid ""
"the `Docutils <https://docutils.sourceforge.io/>`_ project for creating "
"reStructuredText and the Docutils suite;"
msgstr ""
"پروژه `Docutils <https://docutils.sourceforge.io/>`_ برای ایجاد "
"reStructuredText و مجموعهٔ Docutils؛"

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

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

#: ../../about.rst:34
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."
msgstr ""
"افراد زیادی در توسعه زبان پایتون، کتابخانه استاندارد پایتون، و مستندات "
"پایتون مشارکت داشته‌اند. برای مشاهده فهرستی از برخی از این مشارکت‌کنندگان، "
"به :source:`Misc/ACKS` در توزیع سورس پایتون مراجعه کنید."
"پایتون مشارکت داشته‌اند. برای مشاهده فهرستی از برخی از این مشارکت‌کنندگان، به :"
"source:`Misc/ACKS` در توزیع سورس پایتون مراجعه کنید."

#: ../../about.rst:38
msgid ""
"It is only with the input and contributions of the Python community that "
"Python has such wonderful documentation -- Thank You!"
Expand Down
Loading
Loading