Skip to content

Commit 41e7cb1

Browse files
authored
Update translations after syncing with upstream (#68)
1 parent cf56314 commit 41e7cb1

94 files changed

Lines changed: 107204 additions & 24655 deletions

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: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
cpython_tag:
9-
description: 'CPython tag to sync against (e.g. v3.14)'
9+
description: 'CPython tag to sync against (e.g. 3.14)'
1010
required: false
1111
default: '3.14'
1212

@@ -57,11 +57,26 @@ jobs:
5757
--repo ${{ github.repository }} \
5858
2>/dev/null || true
5959
60-
- name: Open issue for fuzzy strings
60+
- name: Open issue for new and fuzzy strings
6161
env:
6262
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6363
run: |
6464
tmpfile=$(mktemp)
65+
66+
# --- New PO files (untracked, since nothing is staged yet) ---
67+
new_files=$(git ls-files --others --exclude-standard -- '*.po' \
68+
':(exclude).cpython-src' ':(exclude).pot-templates')
69+
if [ -n "$new_files" ]; then
70+
new_count=$(echo "$new_files" | wc -l)
71+
{
72+
echo "## 🆕 New PO files ($new_count)"
73+
echo "$new_files" | sed 's/^/- `/; s/$/`/'
74+
echo ""
75+
} >> "$tmpfile"
76+
fi
77+
78+
# --- Fuzzy strings ---
79+
fuzzy_out=$(mktemp)
6580
while IFS= read -r f; do
6681
fuzzy=$(msgattrib --only-fuzzy --no-obsolete "$f" 2>/dev/null)
6782
if [ -n "$fuzzy" ]; then
@@ -80,27 +95,35 @@ jobs:
8095
next
8196
}
8297
')
83-
count=$(echo "$entries" | grep -c '^- ' || echo 0)
84-
if [ "$count" -gt 0 ]; then
85-
echo "### $f ($count fuzzy)" >> "$tmpfile"
86-
echo "$entries" | head -20 >> "$tmpfile"
87-
echo "" >> "$tmpfile"
98+
count=$(echo "$entries" | grep -c '^- ' || true)
99+
if [ "${count:-0}" -gt 0 ]; then
100+
echo "### $f ($count fuzzy)" >> "$fuzzy_out"
101+
echo "$entries" | head -20 >> "$fuzzy_out"
102+
echo "" >> "$fuzzy_out"
88103
fi
89104
fi
90105
done < <(find . -name "*.po" \
91106
-not -path "./.git/*" \
92107
-not -path "./.cpython-src/*" \
93108
-not -path "./.pot-templates/*")
109+
110+
if [ -s "$fuzzy_out" ]; then
111+
{
112+
echo "## 🔍 Fuzzy strings"
113+
cat "$fuzzy_out"
114+
} >> "$tmpfile"
115+
fi
116+
117+
# --- One issue for both ---
94118
if [ -s "$tmpfile" ]; then
119+
echo "Triggered by sync with \`$CPYTHON_TAG\`." >> "$tmpfile"
95120
gh issue create \
96-
--title "🔍 Fuzzy strings need review after CPython sync ($(date +%Y-%m-%d))" \
97-
--body "$(cat "$tmpfile")
98-
99-
Triggered by sync with \`$CPYTHON_TAG\`." \
121+
--title "🔍 Translation review needed after CPython sync ($(date +%Y-%m-%d))" \
122+
--body-file "$tmpfile" \
100123
--label "translation" \
101124
--repo ${{ github.repository }}
102125
fi
103-
rm -f "$tmpfile"
126+
rm -f "$tmpfile" "$fuzzy_out"
104127
105128
- name: Stage changes
106129
run: git add --all

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build:
55
tools:
66
python: "3.12"
77
commands:
8-
- git clone --depth 1 --branch v3.14 https://github.com/python/cpython venv/cpython
8+
- git clone --depth 1 --branch 3.14 https://github.com/python/cpython venv/cpython
99
- pip install -r venv/cpython/Doc/requirements.txt
1010
# Pin Sphinx separately: requirements.txt may resolve to an older version,
1111
# and 9.1.0+ is needed for the reordered- ref / translated-display-text

builtins/functions.po

Lines changed: 2795 additions & 599 deletions
Large diffs are not rendered by default.

builtins/index.po

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,36 @@ msgstr ""
2020
"Content-Transfer-Encoding: 8bit\n"
2121

2222
msgid "Python built-ins reference"
23-
msgstr ""
23+
msgstr "ارجاع توکارهای پایتون"
2424

2525
msgid "Python comes with a number of built-in functions and classes."
26-
msgstr ""
26+
msgstr "پایتون با تعداد زیادی تابع و کلاس توکار ارائه می‌شود."
2727

28-
msgid "The built-in classes include data types that would normally be considered part of the \"core\" of a language, such as numbers and lists. For these types, the Python language core defines the form of literals and places some constraints on their semantics, but does not fully define the semantics."
28+
msgid ""
29+
"The built-in classes include data types that would normally be considered "
30+
"part of the \"core\" of a language, such as numbers and lists. For these "
31+
"types, the Python language core defines the form of literals and places some"
32+
" constraints on their semantics, but does not fully define the semantics."
2933
msgstr ""
34+
"کلاس‌های توکار شامل انواع داده‌ای هستند که معمولاً بخشی از «هسته» یک زبان "
35+
"محسوب می‌شوند، مانند اعداد و فهرست‌ها. برای این انواع، هسته زبان پایتون شکل"
36+
" مقادیر لفظی را تعریف می‌کند و محدودیت‌هایی بر معناشان می‌گذارد، اما معناشان"
37+
" را به طور کامل تعریف نمی‌کند."
3038

31-
msgid "The built-ins also include functions and exceptions --- objects that can be used by all Python code without the need of an :keyword:`import` statement. Some of these are defined by the core language, but many are not essential for the core semantics and are only described here."
39+
msgid ""
40+
"The built-ins also include functions and exceptions --- objects that can be "
41+
"used by all Python code without the need of an :keyword:`import` statement. "
42+
"Some of these are defined by the core language, but many are not essential "
43+
"for the core semantics and are only described here."
3244
msgstr ""
45+
"توکارها همچنین شامل توابع و استثناها --- اشیاء‌ای که می‌توانند توسط تمام "
46+
"کدهای پایتون بدون نیاز به دستور :keyword:`import` استفاده شوند --- می‌باشند."
47+
" برخی از این‌ها توسط زبان هسته تعریف شده‌اند، اما بسیاری برای معنای هسته "
48+
"ضروری نیستند و فقط در اینجا توصیف شده‌اند."
3349

34-
msgid "In addition to the built-ins, Python provides an extensive importable standard library, see :ref:`library-index`."
50+
msgid ""
51+
"In addition to the built-ins, Python provides an extensive importable "
52+
"standard library, see :ref:`library-index`."
3553
msgstr ""
54+
"علاوه بر توکارها، پایتون یک کتابخانه استاندارد گسترده و قابل‌وارد کردن فراهم"
55+
" می‌کند، به :ref:`library-index` مراجعه کنید."

0 commit comments

Comments
 (0)