Skip to content

Commit 4c677e8

Browse files
committed
translation of part of __main.po file
1 parent 8994a37 commit 4c677e8

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

GLOSSARY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
| character | نویسه |
1818
| class | کلاس |
1919
| command line | خط فرمان |
20-
| community | کامیونیتی |
20+
| community | کامیونیتی، انجمن |
2121
| component | کامپوننت |
2222
| custom | سفارشی، اختصاصی |
2323
| decorator | دکوراتور، آراینده |
@@ -65,7 +65,6 @@
6565
| parameter | پارامتر |
6666
| positional | جایگاهی |
6767
| property | ویژگی، پراپرتی، خصوصیت |
68-
| pass | پاس دادن |
6968
| quotation | علامت نقل‌وقول |
7069
| raise | پرتاب |
7170
| return | بازگشت، برگرداندن |

library/__main__.po

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,32 +235,36 @@ msgid "By proactively following this convention ourselves, our module will have
235235
msgstr "با پیروی فعالانه‌ی خودمان از این قرارداد، ماژول ما هنگام اجرای مستقیم (یعنی ``python echo.py``) همان رفتاری را خواهد داشت که در صورت بسته‌بندی بعدی آن به‌عنوان یک نقطه‌ی ورودی اسکریپت کنسول در یک بسته‌ی قابل نصب با pip خواهد داشت."
236236

237237
msgid "In particular, be careful about returning strings from your ``main`` function. :func:`sys.exit` will interpret a string argument as a failure message, so your program will have an exit code of ``1``, indicating failure, and the string will be written to :data:`sys.stderr`. The ``echo.py`` example from earlier exemplifies using the ``sys.exit(main())`` convention."
238-
msgstr ""
238+
msgstr "به‌ویژه، در مورد بازگرداندن رشته‌ها از تابع ``main`` خود دقت کنید. :func:`sys.exit` یک آرگومان رشته‌ای را به‌عنوان پیام شکست تفسیر می‌کند، بنابراین برنامه‌ی شما کد خروجی ``1`` را خواهد داشت که نشان‌دهنده‌ی شکست است و رشته به :data:`sys.stderr` نوشته می‌شود. مثال ``echo.py`` از قبل، استفاده از قرارداد ``sys.exit(main())`` را به‌خوبی نشان می‌دهد."
239239

240240
msgid "`Python Packaging User Guide <https://packaging.python.org/>`_ contains a collection of tutorials and references on how to distribute and install Python packages with modern tools."
241-
msgstr ""
241+
msgstr "`Python Packaging User Guide <https://packaging.python.org/>`_ شامل مجموعه‌ای از آموزش‌ها و مراجع درباره‌ی نحوه‌ی توزیع و نصب بسته‌های پایتون با ابزارهای مدرن است."
242242

243243
msgid "``__main__.py`` in Python Packages"
244-
msgstr ""
244+
msgstr "``__main__.py`` در بسته‌های پایتون"
245245

246246
msgid "If you are not familiar with Python packages, see section :ref:`tut-packages` of the tutorial. Most commonly, the ``__main__.py`` file is used to provide a command-line interface for a package. Consider the following hypothetical package, \"bandclass\":"
247-
msgstr ""
247+
msgstr "اگر با بسته‌های پایتون آشنایی ندارید، به بخش :ref:`tut-packages` از آموزش مراجعه کنید. معمولاً، از فایل ``__main__.py`` برای ارائه‌ی یک رابط خط فرمان برای یک بسته استفاده می‌شود. بسته‌ی فرضی زیر را در نظر بگیرید، \"bandclass\":"
248248

249249
msgid ""
250250
"bandclass\n"
251251
" ├── __init__.py\n"
252252
" ├── __main__.py\n"
253253
" └── student.py"
254254
msgstr ""
255+
"bandclass\n"
256+
" ├── __init__.py\n"
257+
" ├── __main__.py\n"
258+
" └── student.py"
255259

256260
msgid "``__main__.py`` will be executed when the package itself is invoked directly from the command line using the :option:`-m` flag. For example:"
257-
msgstr ""
261+
msgstr "``__main__.py`` زمانی اجرا می‌شود که خود بسته مستقیماً از خط فرمان با استفاده از پرچم :option:`-m` فراخوانی شود. برای مثال:"
258262

259263
msgid "$ python -m bandclass"
260-
msgstr ""
264+
msgstr "$ python -m bandclass"
261265

262266
msgid "This command will cause ``__main__.py`` to run. How you utilize this mechanism will depend on the nature of the package you are writing, but in this hypothetical case, it might make sense to allow the teacher to search for students::"
263-
msgstr ""
267+
msgstr "این دستور باعث اجرای ``__main__.py`` می‌شود. نحوه‌ی استفاده‌ی شما از این مکانیزم به ماهیت بسته‌ای که می‌نویسید بستگی دارد، اما در این حالت فرضی، ممکن است منطقی باشد که به معلم اجازه دهید دانش‌آموزان را جستجو کند::"
264268

265269
msgid ""
266270
"# bandclass/__main__.py\n"
@@ -271,9 +275,16 @@ msgid ""
271275
"student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n"
272276
"print(f'Found student: {search_students(student_name)}')"
273277
msgstr ""
278+
"# bandclass/__main__.py\n"
279+
"\n"
280+
"import sys\n"
281+
"from .student import search_students\n"
282+
"\n"
283+
"student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n"
284+
"print(f'Found student: {search_students(student_name)}')"
274285

275286
msgid "Note that ``from .student import search_students`` is an example of a relative import. This import style can be used when referencing modules within a package. For more details, see :ref:`intra-package-references` in the :ref:`tut-modules` section of the tutorial."
276-
msgstr ""
287+
msgstr "توجه داشته باشید که ``from .student import search_students`` مثالی از یک ایمپورت نسبی است. این سبک ایمپورت را می‌توان هنگام ارجاع به ماژول‌های درون یک بسته استفاده کرد. برای اطلاعات بیشتر، به :ref:`intra-package-references` در بخش :ref:`tut-modules` از آموزش مراجعه کنید."
277288

278289
msgid "The content of ``__main__.py`` typically isn't fenced with an ``if __name__ == '__main__'`` block. Instead, those files are kept short and import functions to execute from other modules. Those other modules can then be easily unit-tested and are properly reusable."
279290
msgstr ""

0 commit comments

Comments
 (0)