Skip to content

Commit c669285

Browse files
chore: sync msgids with CPython 3.15
1 parent 85aa8b6 commit c669285

48 files changed

Lines changed: 638 additions & 124 deletions

Some content is hidden

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

‎c-api/module.po‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: Python 3.14\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2026-11-02 04:12+0000\n"
16+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1717
"PO-Revision-Date: 2026-10-06 20:44+0330\n"
1818
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
1919
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -354,20 +354,35 @@ msgstr "توکن ماژول"
354354
msgid "Each module may have an associated *token*: a pointer-sized value intended to identify of the module state's memory layout. This means that if you have a module object, but you are not sure if it “belongs” to your extension, you can check using code like this:"
355355
msgstr "هر ماژول ممکن است یک *توکن* (token) مرتبط داشته باشد: مقداری به اندازه‌ی اشاره‌گر که برای شناسایی چیدمان حافظه‌ی وضعیت ماژول در نظر گرفته شده است. این یعنی اگر شیء ماژولی دارید، اما مطمئن نیستید که آیا به افزونه‌ی شما «تعلق» دارد یا خیر، می‌توانید با استفاده از کدی شبیه به این آن را بررسی کنید:"
356356

357+
#, fuzzy
358+
#| msgid ""
359+
#| "PyObject *module = <the module in question>\n"
360+
#| "\n"
361+
#| "void *module_token;\n"
362+
#| "if (PyModule_GetToken(module, &module_token) < 0) {\n"
363+
#| " return NULL;\n"
364+
#| "}\n"
365+
#| "if (module_token != your_token) {\n"
366+
#| " PyErr_SetString(PyExc_ValueError, \"unexpected module\")\n"
367+
#| " return NULL;\n"
368+
#| "}\n"
369+
#| "\n"
370+
#| "// This module's state has the expected memory layout; it's safe to cast\n"
371+
#| "struct my_state state = (struct my_state*)PyModule_GetState(module)"
357372
msgid ""
358-
"PyObject *module = <the module in question>\n"
373+
"PyObject *module = <the module in question>;\n"
359374
"\n"
360375
"void *module_token;\n"
361376
"if (PyModule_GetToken(module, &module_token) < 0) {\n"
362377
" return NULL;\n"
363378
"}\n"
364379
"if (module_token != your_token) {\n"
365-
" PyErr_SetString(PyExc_ValueError, \"unexpected module\")\n"
380+
" PyErr_SetString(PyExc_ValueError, \"unexpected module\");\n"
366381
" return NULL;\n"
367382
"}\n"
368383
"\n"
369384
"// This module's state has the expected memory layout; it's safe to cast\n"
370-
"struct my_state state = (struct my_state*)PyModule_GetState(module)"
385+
"struct my_state *state = (struct my_state*)PyModule_GetState(module);"
371386
msgstr ""
372387
"PyObject *module = <the module in question>\n"
373388
"\n"

‎c-api/typeobj.po‎

Lines changed: 26 additions & 2 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-11-06 04:12+0000\n"
17+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1818
"PO-Revision-Date: 2026-09-15 08:25+0330\n"
1919
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
2020
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -2839,6 +2839,30 @@ msgstr ""
28392839
msgid "A type that supports weakrefs, instance dicts, and hashing::"
28402840
msgstr "نوعی که از ارجاع‌های ضعیف، دیکشنری‌های نمونه و هش کردن پشتیبانی می‌کند::"
28412841

2842+
#, fuzzy
2843+
#| msgid ""
2844+
#| "typedef struct {\n"
2845+
#| " PyObject_HEAD\n"
2846+
#| " const char *data;\n"
2847+
#| "} MyObject;\n"
2848+
#| "\n"
2849+
#| "static PyTypeObject MyObject_Type = {\n"
2850+
#| " PyVarObject_HEAD_INIT(NULL, 0)\n"
2851+
#| " .tp_name = \"mymod.MyObject\",\n"
2852+
#| " .tp_basicsize = sizeof(MyObject),\n"
2853+
#| " .tp_doc = PyDoc_STR(\"My objects\"),\n"
2854+
#| " .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |\n"
2855+
#| " Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_MANAGED_DICT |\n"
2856+
#| " Py_TPFLAGS_MANAGED_WEAKREF,\n"
2857+
#| " .tp_new = myobj_new,\n"
2858+
#| " .tp_traverse = (traverseproc)myobj_traverse,\n"
2859+
#| " .tp_clear = (inquiry)myobj_clear,\n"
2860+
#| " .tp_alloc = PyType_GenericNew,\n"
2861+
#| " .tp_dealloc = (destructor)myobj_dealloc,\n"
2862+
#| " .tp_repr = (reprfunc)myobj_repr,\n"
2863+
#| " .tp_hash = (hashfunc)myobj_hash,\n"
2864+
#| " .tp_richcompare = PyBaseObject_Type.tp_richcompare,\n"
2865+
#| "};"
28422866
msgid ""
28432867
"typedef struct {\n"
28442868
" PyObject_HEAD\n"
@@ -2856,7 +2880,7 @@ msgid ""
28562880
" .tp_new = myobj_new,\n"
28572881
" .tp_traverse = (traverseproc)myobj_traverse,\n"
28582882
" .tp_clear = (inquiry)myobj_clear,\n"
2859-
" .tp_alloc = PyType_GenericNew,\n"
2883+
" .tp_alloc = PyType_GenericAlloc,\n"
28602884
" .tp_dealloc = (destructor)myobj_dealloc,\n"
28612885
" .tp_repr = (reprfunc)myobj_repr,\n"
28622886
" .tp_hash = (hashfunc)myobj_hash,\n"

‎extending/embedding.po‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: Python 3.14\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2026-09-16 12:56+0000\n"
16+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1717
"PO-Revision-Date: 2026-09-04 20:28+0330\n"
1818
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
1919
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -123,7 +123,9 @@ msgstr ""
123123
msgid "``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should be used in some APIs instead of ``int``. It is not necessary since Python 3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-string-and-buffers` for a description of this macro."
124124
msgstr "``#define PY_SSIZE_T_CLEAN`` برای نشان دادن این نکته استفاده می‌شد که در برخی API‌ها باید به‌جای ``int`` از ``Py_ssize_t`` استفاده شود. از پایتون 3.13 به بعد دیگر لازم نیست، اما برای سازگاری با نسخه‌های پیشین، آن را اینجا نگه می‌داریم. برای شرح این ماکرو به :ref:`arg-parsing-string-and-buffers` مراجعه کنید."
125125

126-
msgid "Setting :c:member:`PyConfig.program_name` should be called before :c:func:`Py_InitializeFromConfig` to inform the interpreter about paths to Python run-time libraries. Next, the Python interpreter is initialized with :c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the trouble of allocating memory space and loading the file contents."
126+
#, fuzzy
127+
#| msgid "Setting :c:member:`PyConfig.program_name` should be called before :c:func:`Py_InitializeFromConfig` to inform the interpreter about paths to Python run-time libraries. Next, the Python interpreter is initialized with :c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the trouble of allocating memory space and loading the file contents."
128+
msgid "Setting :c:member:`PyConfig.program_name` should be called before :c:func:`Py_InitializeFromConfig` to inform the interpreter about paths to Python run-time libraries. Next, the Python interpreter is initialized with :c:func:`Py_InitializeFromConfig`, followed by the execution of a hard-coded Python script that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the trouble of allocating memory space and loading the file contents."
127129
msgstr "تنظیم :c:member:`PyConfig.program_name` باید پیش از :c:func:`Py_InitializeFromConfig` انجام شود تا مفسر را از مسیرهای کتابخانه‌های زمان اجرای پایتون آگاه کند. سپس، مفسر پایتون با :c:func:`Py_Initialize` مقداردهی اولیه می‌شود و در ادامه، یک اسکریپت پایتونِ هاردکد‌شده (hard-coded) که تاریخ و زمان را چاپ می‌کند، اجرا می‌شود. پس از آن، فراخوانی :c:func:`Py_FinalizeEx` مفسر را متوقف می‌کند و در نهایت برنامه به پایان می‌رسد. در یک برنامه‌ی واقعی، ممکن است بخواهید اسکریپت پایتون را از منبع دیگری دریافت کنید؛ مثلاً از یک روتین ویرایشگر متن، یک پرونده یا یک پایگاه داده. گرفتن کد پایتون از یک پرونده را بهتر می‌توان با استفاده از تابع :c:func:`PyRun_SimpleFile` انجام داد که شما را از دردسر تخصیص فضای حافظه و بارگذاری محتوای پرونده بی‌نیاز می‌کند."
128130

129131
msgid "Beyond Very High Level Embedding: An overview"

‎extending/extending.po‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: Python 3.14\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2026-10-31 04:10+0000\n"
16+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1717
"PO-Revision-Date: 2026-10-06 19:58+0330\n"
1818
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
1919
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -1035,7 +1035,9 @@ msgstr ""
10351035
" return 0;\n"
10361036
"}"
10371037

1038-
msgid "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array would disappear when :c:func:`!PyInit_spam` terminates!"
1038+
#, fuzzy
1039+
#| msgid "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array would disappear when :c:func:`!PyInit_spam` terminates!"
1040+
msgid "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array would disappear when :c:func:`!spam_module_exec` terminates!"
10391041
msgstr "توجه داشته باشید که ``PySpam_API`` به‌صورت ``static`` تعریف شده است؛ در غیر این صورت، آرایه اشاره‌گرها با خاتمه‌یافتن :c:func:`!PyInit_spam` ناپدید می‌شد!"
10401042

10411043
msgid "The bulk of the work is in the header file :file:`spammodule.h`, which looks like this::"

‎howto/descriptor.po‎

Lines changed: 14 additions & 2 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-11-06 04:12+0000\n"
17+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1818
"PO-Revision-Date: 2026-10-06 19:56+0330\n"
1919
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
2020
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -1760,13 +1760,25 @@ msgstr ""
17601760
msgid "The :meth:`!type.__new__` method takes care of adding member objects to class variables:"
17611761
msgstr "متد :meth:`!type.__new__` افزودن اشیای عضو به متغیرهای کلاس را بر عهده دارد:"
17621762

1763+
#, fuzzy
1764+
#| msgid ""
1765+
#| "class Type(type):\n"
1766+
#| " 'Simulate how the type metaclass adds member objects for slots'\n"
1767+
#| "\n"
1768+
#| " def __new__(mcls, clsname, bases, mapping, **kwargs):\n"
1769+
#| " 'Emulate type_new() in Objects/typeobject.c'\n"
1770+
#| " # type_new() calls PyTypeReady() which calls add_methods()\n"
1771+
#| " slot_names = mapping.get('slot_names', [])\n"
1772+
#| " for offset, name in enumerate(slot_names):\n"
1773+
#| " mapping[name] = Member(name, clsname, offset)\n"
1774+
#| " return type.__new__(mcls, clsname, bases, mapping, **kwargs)"
17631775
msgid ""
17641776
"class Type(type):\n"
17651777
" 'Simulate how the type metaclass adds member objects for slots'\n"
17661778
"\n"
17671779
" def __new__(mcls, clsname, bases, mapping, **kwargs):\n"
17681780
" 'Emulate type_new() in Objects/typeobject.c'\n"
1769-
" # type_new() calls PyTypeReady() which calls add_methods()\n"
1781+
" # type_new() calls PyType_Ready() which calls add_methods()\n"
17701782
" slot_names = mapping.get('slot_names', [])\n"
17711783
" for offset, name in enumerate(slot_names):\n"
17721784
" mapping[name] = Member(name, clsname, offset)\n"

‎howto/instrumentation.po‎

Lines changed: 43 additions & 3 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-11-02 04:12+0000\n"
17+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1818
"PO-Revision-Date: 2021-06-28 00:53+0000\n"
1919
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
2020
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -535,11 +535,31 @@ msgstr "روش سطح بالاتر برای استفاده از یکپارچه
535535
msgid "Here is a tapset file, based on a non-shared build of CPython:"
536536
msgstr "در اینجا یک پرونده‌ی tapset، بر پایه‌ی یک ساخت غیراشتراکی از CPython، آمده است:"
537537

538+
#, fuzzy
539+
#| msgid ""
540+
#| "/*\n"
541+
#| " Provide a higher-level wrapping around the function__entry and\n"
542+
#| " function__return markers:\n"
543+
#| " \\*/\n"
544+
#| "probe python.function.entry = process(\"python\").mark(\"function__entry\")\n"
545+
#| "{\n"
546+
#| " filename = user_string($arg1);\n"
547+
#| " funcname = user_string($arg2);\n"
548+
#| " lineno = $arg3;\n"
549+
#| " frameptr = $arg4\n"
550+
#| "}\n"
551+
#| "probe python.function.return = process(\"python\").mark(\"function__return\")\n"
552+
#| "{\n"
553+
#| " filename = user_string($arg1);\n"
554+
#| " funcname = user_string($arg2);\n"
555+
#| " lineno = $arg3;\n"
556+
#| " frameptr = $arg4\n"
557+
#| "}"
538558
msgid ""
539559
"/*\n"
540560
" Provide a higher-level wrapping around the function__entry and\n"
541561
" function__return markers:\n"
542-
" \\*/\n"
562+
" */\n"
543563
"probe python.function.entry = process(\"python\").mark(\"function__entry\")\n"
544564
"{\n"
545565
" filename = user_string($arg1);\n"
@@ -619,6 +639,26 @@ msgstr ""
619639
msgid "The following script uses the tapset above to provide a top-like view of all running CPython code, showing the top 20 most frequently entered bytecode frames, each second, across the whole system:"
620640
msgstr "اسکریپت زیر از tapset بالا برای ارائه نمایی مشابه top از تمام کدهای CPython در حال اجرا استفاده می‌کند و هر ثانیه، ۲۰ فریم بایت‌کد با بیشترین تعداد ورود در سراسر سیستم را نشان می‌دهد:"
621641

642+
#, fuzzy
643+
#| msgid ""
644+
#| "global fn_calls;\n"
645+
#| "\n"
646+
#| "probe python.function.entry\n"
647+
#| "{\n"
648+
#| " fn_calls[pid(), filename, funcname, lineno] += 1;\n"
649+
#| "}\n"
650+
#| "\n"
651+
#| "probe timer.ms(1000) {\n"
652+
#| " printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n"
653+
#| " printf(\"%6s %80s %6s %30s %6s\\n\",\n"
654+
#| " \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n"
655+
#| " foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n"
656+
#| " printf(\"%6d %80s %6d %30s %6d\\n\",\n"
657+
#| " pid, filename, lineno, funcname,\n"
658+
#| " fn_calls[pid, filename, funcname, lineno]);\n"
659+
#| " }\n"
660+
#| " delete fn_calls;\n"
661+
#| "}"
622662
msgid ""
623663
"global fn_calls;\n"
624664
"\n"
@@ -628,7 +668,7 @@ msgid ""
628668
"}\n"
629669
"\n"
630670
"probe timer.ms(1000) {\n"
631-
" printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n"
671+
" printf(\"\\033[2J\\033[1;1H\") /* clear screen */\n"
632672
" printf(\"%6s %80s %6s %30s %6s\\n\",\n"
633673
" \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n"
634674
" foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n"

‎howto/isolating-extensions.po‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: Python 3.14\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2026-11-06 04:12+0000\n"
16+
"POT-Creation-Date: 2026-11-08 04:10+0000\n"
1717
"PO-Revision-Date: 2026-09-14 13:04+0330\n"
1818
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
1919
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
@@ -560,6 +560,31 @@ msgstr "پس از اینکه کلاس تعریف‌کننده را در اختی
560560
msgid "For example::"
561561
msgstr "برای مثال::"
562562

563+
#, fuzzy
564+
#| msgid ""
565+
#| "static PyObject *\n"
566+
#| "example_method(PyObject *self,\n"
567+
#| " PyTypeObject *defining_class,\n"
568+
#| " PyObject *const *args,\n"
569+
#| " Py_ssize_t nargs,\n"
570+
#| " PyObject *kwnames)\n"
571+
#| "{\n"
572+
#| " my_struct *state = (my_struct*)PyType_GetModuleState(defining_class);\n"
573+
#| " if (state == NULL) {\n"
574+
#| " return NULL;\n"
575+
#| " }\n"
576+
#| " ... // rest of logic\n"
577+
#| "}\n"
578+
#| "\n"
579+
#| "PyDoc_STRVAR(example_method_doc, \"...\");\n"
580+
#| "\n"
581+
#| "static PyMethodDef my_methods[] = {\n"
582+
#| " {\"example_method\",\n"
583+
#| " (PyCFunction)(void(*)(void))example_method,\n"
584+
#| " METH_METHOD|METH_FASTCALL|METH_KEYWORDS,\n"
585+
#| " example_method_doc}\n"
586+
#| " {NULL},\n"
587+
#| "}"
563588
msgid ""
564589
"static PyObject *\n"
565590
"example_method(PyObject *self,\n"
@@ -581,9 +606,9 @@ msgid ""
581606
" {\"example_method\",\n"
582607
" (PyCFunction)(void(*)(void))example_method,\n"
583608
" METH_METHOD|METH_FASTCALL|METH_KEYWORDS,\n"
584-
" example_method_doc}\n"
609+
" example_method_doc},\n"
585610
" {NULL},\n"
586-
"}"
611+
"};"
587612
msgstr ""
588613
"static PyObject *\n"
589614
"example_method(PyObject *self,\n"

0 commit comments

Comments
 (0)