Skip to content
Closed
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: راهنمای مشارکت (CONTRIBUTING.md)
url: https://github.com/python/python-docs-fa/blob/3.14/CONTRIBUTING.md
url: https://github.com/revisto/python-docs-fa/blob/3.14/CONTRIBUTING.md
about: پیش از ثبت issue، لطفاً راهنمای مشارکت و README را مطالعه کنید
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: python/cpython
ref: v3.14.7
ref: v3.14.6

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: python/cpython
ref: v3.14.7
ref: v3.14.6

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
83 changes: 71 additions & 12 deletions .github/workflows/sync-with-cpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
workflow_dispatch:
inputs:
cpython_tag:
description: 'CPython tag to sync against (e.g. v3.14.7)'
description: 'CPython tag to sync against (e.g. v3.14.6)'
required: false
default: 'v3.14.7'
default: 'v3.14.6'

permissions:
contents: write
Expand All @@ -21,8 +21,6 @@ concurrency:
jobs:
sync:
runs-on: ubuntu-latest
env:
CPYTHON_TAG: ${{ github.event.inputs.cpython_tag || 'v3.14.7' }}
steps:
- name: Checkout translation repo
uses: actions/checkout@v4
Expand All @@ -40,12 +38,41 @@ jobs:
- name: Install Python dependencies
run: pip install sphinx sphinx-intl

# Item 4: fetch/build/merge/validate now all live in one shared
# module (scripts/po_sync.py) instead of inline bash/awk here, so
# this workflow can't drift from update_python_version.py the way
# it did before (missing --no-location --no-wrap on one side).
- name: Sync msgids (fetch, build gettext, merge, validate)
run: python scripts/po_sync.py sync-only "$CPYTHON_TAG"
- 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 --no-wrap "$po" "$f"
fi
done

- name: Ensure translation label exists
env:
Expand All @@ -60,6 +87,7 @@ jobs:
- 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
Expand Down Expand Up @@ -102,11 +130,41 @@ jobs:
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: Stage changes
run: git add --all

- name: Unstage POT-Creation-Date-only changes
run: python scripts/unstage_cosmetic.py
run: |
git diff --staged --name-only | while read f; do
if git diff --staged -U0 -- "$f" \
| grep '^[+-]' \
| grep -v '^[+-][+-][+-]' \
| grep -qv 'POT-Creation-Date'; then
: # has real changes, keep staged
else
git restore --staged "$f"
git restore "$f"
fi
done

- name: Commit if changed
run: |
Expand All @@ -116,5 +174,6 @@ jobs:
echo "Nothing to commit, skipping."
exit 0
fi
git commit -m "chore: sync msgids with CPython $CPYTHON_TAG"
git commit -m \
"chore: sync msgids with CPython ${{ github.event.inputs.cpython_tag || 'v3.14.6' }}"
git push
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ build:
fi
echo "Continuing build."
exit 0
- git clone --depth 1 --branch v3.14.7 https://github.com/python/cpython venv/cpython
- git clone --depth 1 --branch v3.14.6 https://github.com/python/cpython venv/cpython
- pip install -r venv/cpython/Doc/requirements.txt
- mkdir -p venv/cpython/Doc/locales/fa/LC_MESSAGES
- cp --parents *.po venv/cpython/Doc/locales/fa/LC_MESSAGES/
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
```bash
git clone https://github.com/<username>/python-docs-fa.git
cd python-docs-fa
git remote add upstream https://github.com/python/python-docs-fa.git
git remote add upstream https://github.com/revisto/python-docs-fa.git
```
2. یک شاخه برای کارتان بسازید (نام شاخه باید گویا باشد، مثلاً `translate-something`):
```bash
Expand Down Expand Up @@ -45,7 +45,7 @@
2. فایل `.po` مورد نظر را با [Poedit](https://poedit.net) یا هر ویرایشگر متنی باز کنید.
- در Poedit رشته‌های ترجمه‌نشده یا `fuzzy` را از پنل فیلتر (Filter) پیدا کنید.
3. متن `msgid` را ترجمه کنید و در `msgstr` وارد کنید.
4. **نشانه‌گذاری‌های Sphinx** مثل `` :class:`int` `` ، `` :func:`repr` `` ، `` :ref:`...` `` ، `` ``code`` `` و **جای‌گذارها** مثل `%s` یا `{name}` را دقیقاً بدون تغییر نگه دارید؛ فقط متن اطراف آن‌ها ترجمه می‌شود. در `` :term:`target` ``، اگر عبارت داخل بک‌تیک با شناسهٔ واژه‌نامه یکی است، می‌توانید آن را به شکل `` :term:`ترجمه <target>` `` بنویسید تا هم متن ترجمه‌شده نمایش داده شود و هم لینک درست کار کند؛ در این حالت فقط بخش نمایشی (پیش از `<`) ترجمه می‌شود و `target` داخل `<>` باید دقیقاً همان شناسهٔ انگلیسی اصلی (بدون تغییر) باقی بماند، چون تغییر آن لینک را خراب می‌کند.
4. **نشانه‌گذاری‌های Sphinx** مثل `` :class:`int` `` ، `` :func:`repr` `` ، `` :ref:`...` `` ، `` ``code`` `` و **جای‌گذارها** مثل `%s` یا `{name}` را دقیقاً بدون تغییر نگه دارید؛ فقط متن اطراف آن‌ها ترجمه می‌شود. ترجمهٔ `target` در `` :term:`text <target>` `` ممنوع است چون لینک را خراب می‌کند.
5. داخل کدها (بلوک‌های `code-block`) نام متغیرها، توابع و کلمات کلیدی را ترجمه نکنید؛ فقط رشته‌ها و کامنت‌ها را می‌توانید ترجمه کنید.
6. از [واژه‌نامهٔ پروژه (GLOSSARY.md)](GLOSSARY.md) برای ثابت نگه‌داشتن اصطلاحات استفاده کنید.
7. اگر به اصطلاحی برخوردید که در واژه‌نامه نبود، ترجمه‌ای برای آن انتخاب کنید و به واژه‌نامه اضافه کنید.
Expand Down Expand Up @@ -105,7 +105,7 @@ python3 scripts/update_po_headers.py --dry-run

# فقط اصلاح فیلد Language-Team بدون دست‌زدن به اعتبارها
python3 scripts/update_po_headers.py --no-credits \
--language-team "Persian (https://github.com/python/python-docs-fa/)" \
--language-team "Persian (https://github.com/revisto/python-docs-fa/)" \
bugs.po tutorial/

# ادغام نام‌های جدید با فهرست موجود (نام‌های قبلی حذف نمی‌شوند)
Expand Down
173 changes: 77 additions & 96 deletions GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,99 +5,80 @@
> این واژه‌نامه با الهام از واژه‌نامه پروژهٔ ترجمه مستندات Vue.js به فارسی تهیه شده و از ساختار و توضیحات دقیق اون استفاده شده. با تشکر از مشارکت‌کنندگان این پروژه برای زحماتشون:
> https://github.com/vuejs-translations/docs-fa/blob/main/GLOSSARY.md

| English | فارسی |
| ------------------ | ----------------------- |
| accessibility | دسترسی‌پذیری |
| API | API |
| argument | آرگومان |
| async | ناهمگام، غیرهمگام |
| attribute | ویژگی، صفت، شاخصه |
| await | await |
| boolean | بولی |
| built-in | توکار، درونی، درون‌ساخته |
| cache | نهانگاه |
| callback | کال‌بک، فراخوانی بازگشتی |
| character | نویسه |
| class | کلاس |
| command line | خط فرمان |
| community | کامیونیتی |
| component | کامپوننت |
| context management | مدیریت زمینه |
| coroutine | هم‌روال |
| custom | سفارشی، اختصاصی |
| debugging | اشکال‌زدایی، دیباگ کردن |
| decoding | کدگشایی |
| decorator | دکوراتور، آراینده |
| dependency | وابستگی |
| deprecated | منسوخ، از رده خارج شده |
| dictionary | دیکشنری |
| directory | پوشه |
| DOM | DOM |
| duck-typing | نوع‌دهی اردکی |
| ecosystem | اکوسیستم |
| element | المان، عنصر |
| encoding | کدگذاری |
| endpoint | پایانه |
| escape | خنثی کردن |
| event | رویداد |
| exception | استثنا |
| expression | عبارت |
| f-string | اف‌استرینگ |
| function | تابع |
| garbage collection | زباله‌روبی |
| generator | تولیدگر |
| generic function | تابع عام، تابع عمومی |
| global | سراسری |
| hexadecimal | مبنای شانزده |
| immortal | نامیرا |
| immutable | تغییرناپذیر |
| import | ایمپورت |
| index | اندیس، شماره |
| instance | نمونه |
| integer | عدد صحیح |
| interface | رابط |
| interpreter | مفسر |
| item | آیتم |
| iterable | تکرارپذیر |
| keyword | کلیدواژه |
| keyword argument | آرگومان کلیدواژه‌ای |
| list | فهرست |
| list comprehension | درک فهرستی |
| load | بارگذاری |
| loader | بارگذار |
| local | محلی |
| loop | حلقه |
| metaclass | فراکلاس |
| method | متد |
| mock | ماک |
| module | ماژول |
| mutable | تغییرپذیر |
| namespace | نام‌فضا |
| object | شیء |
| operator | عملگر |
| package | بسته |
| parallelism | موازی‌سازی |
| parameter | پارامتر |
| positional | جایگاهی |
| property | ویژگی، پراپرتی، خصوصیت |
| quotation | علامت نقل‌قول |
| race | رقابت |
| raise | پرتاب |
| return | بازگشت، برگرداندن |
| runtime | ران‌تایم |
| scope | محدوده |
| shadowing | پوشاندن |
| shell | پوسته |
| stack traceback | ردگیری پشته |
| statement | دستور |
| string | رشته |
| syntactic sugar | قند نحوی |
| syntax | سینتکس، نحو |
| thread | نخ |
| tracking | پیگیری |
| type | نوع، نوع داده، تایپ |
| unit test | یونیت تست |
| unpacking | واگشایی |
| value | مقدار |
| variable | متغیر |
| wrapper | پوششی، دربرگیرنده |
| English | فارسی |
| ---------------- | ------------------------ |
| accessibility | دسترسی‌پذیری |
| argument | آرگومان |
| async | ناهمگام، غیرهمگام |
| attribute | ویژگی، صفت، شاخصه |
| boolean | بولی |
| built-in | توکار، درونی، درون‌ساخته |
| callback | کال‌بک، فراخوانی بازگشتی |
| character | نویسه |
| class | کلاس |
| command line | خط فرمان |
| community | کامیونیتی، انجمن |
| component | کامپوننت |
| custom | سفارشی، اختصاصی |
| decorator | دکوراتور، آراینده |
| debugging | اشکال‌زدایی، دیباگ کردن |
| deprecated | منسوخ، از رده خارج شده |
| dependency | وابستگی |
| dictionary | دیکشنری |
| directory | پوشه |
| DOM | DOM |
| element | المان، عنصر |
| endpoint | پایانه |
| escape | خنثی کردن |
| ecosystem | اکوسیستم |
| event | رویداد |
| exception | استثنا |
| expression | عبارت |
| function | تابع |
| generator | تولیدگر |
| global | سراسری |
| import | ایمپورت |
| immutable | تغییرناپذیر |
| index | اندیس، شماره |
| instance | نمونه |
| integer | عدد صحیح |
| interface | رابط |
| interpreter | مفسر |
| item | آیتم |
| iterable | تکرارپذیر |
| keyword | کلیدواژه |
| keyword argument | آرگومان کلیدواژه‌ای |
| list | فهرست |
| list comprehension | درک فهرستی |
| load | بارگذاری |
| loader | بارگذار |
| local | محلی |
| loop | حلقه |
| method | متد، روش |
| mock | ماک |
| module | ماژول |
| mutable | تغییرپذیر |
| namespace | نام‌فضا |
| object | شیء |
| operator | عملگر |
| package | بسته |
| parameter | پارامتر |
| positional | جایگاهی |
| property | ویژگی، پراپرتی، خصوصیت |
| quotation | علامت نقل‌وقول |
| raise | پرتاب |
| return | بازگشت، برگرداندن |
| runtime | ران‌تایم |
| scope | محدوده |
| shadowing | پوشاندن |
| stack traceback | ردگیری پشته |
| statement | دستور |
| string | رشته |
| syntax | سینتکس، نحو |
| Tracking | پیگیری |
| type | نوع، نوع داده، تایپ |
| unit test | یونیت تست |
| unpacking | واگشایی |
| value | مقدار |
| variable | متغیر |
| wrapper | پوششی، دربرگیرنده |
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@

<!-- STATS_START -->
### مشارکت‌های کاربران
![نمودار مشارکت‌های کاربران؛ Revisto 3984، sepehr-rs 2210، 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-27)
![نمودار مشارکت‌های کاربران؛ 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-21)
<!-- STATS_END -->
Loading
Loading