@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.10\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2023-07-29 03:05 +0000\n "
14
+ "POT-Creation-Date : 2023-08-25 15:13 +0000\n "
15
15
"PO-Revision-Date : 2022-11-05 17:21+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2023\n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -45,6 +45,8 @@ msgid ""
45
45
"environment variables and command line arguments are used to configure "
46
46
"Python."
47
47
msgstr ""
48
+ ":ref:`Python 配置 <init-python-config>` 可被用于构建一个定制的 Python,其行为与常规 Python 类似。 "
49
+ "例如,环境变量和命令行参数可被用于配置 Python。"
48
50
49
51
#: ../../c-api/init_config.rst:22
50
52
msgid ""
@@ -53,6 +55,8 @@ msgid ""
53
55
" environment variables are ignored, the LC_CTYPE locale is left unchanged "
54
56
"and no signal handler is registered."
55
57
msgstr ""
58
+ ":ref:`隔离配置 <init-isolated-conf>` 可被用于将 Python 嵌入到应用程序。 它将 Python 与系统隔离开来。 "
59
+ "例如,环境变量将被忽略,LC_CTYPE 语言区域设置保持不变并且不会注册任何信号处理句柄。"
56
60
57
61
#: ../../c-api/init_config.rst:27
58
62
msgid ""
@@ -205,12 +209,15 @@ msgid ""
205
209
"exit with a non-zero exit code if *status* is an error. Must only be called"
206
210
" if ``PyStatus_Exception(status)`` is non-zero."
207
211
msgstr ""
212
+ "如果 *status* 是一个退出码则调用 ``exit(exitcode)``。如果 *status* "
213
+ "是一个错误码则打印错误消息并设置一个非零退出码再退出。 必须在 ``PyStatus_Exception(status)`` 为非零值时才能被调用。"
208
214
209
215
#: ../../c-api/init_config.rst:180
210
216
msgid ""
211
217
"Internally, Python uses macros which set ``PyStatus.func``, whereas "
212
218
"functions to create a status set ``func`` to ``NULL``."
213
219
msgstr ""
220
+ "在内部,Python 将使用设置 ``PyStatus.func`` 的宏,而创建状态的函数则会将 ``func`` 设为 ``NULL``。"
214
221
215
222
#: ../../c-api/init_config.rst:183
216
223
msgid "Example::"
@@ -386,13 +393,13 @@ msgstr "设置 :c:member:`PyConfig.filesystem_errors` 为 ``\"replace\"``."
386
393
msgid ""
387
394
"Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment "
388
395
"variable value."
389
- msgstr ""
396
+ msgstr "初始化来自 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 的环境变量值。 "
390
397
391
398
#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:810
392
399
msgid ""
393
400
"Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for "
394
401
"Windows specific code."
395
- msgstr ""
402
+ msgstr "仅在 Windows 上可用。 ``#ifdef MS_WINDOWS`` 宏可被用于 Windows 专属的代码。 "
396
403
397
404
#: ../../c-api/init_config.rst:310 ../../c-api/init_config.rst:588
398
405
#: ../../c-api/init_config.rst:595 ../../c-api/init_config.rst:646
@@ -462,44 +469,51 @@ msgid ""
462
469
"Set the :ref:`Python UTF-8 Mode <utf8-mode>` "
463
470
"(:c:member:`PyPreConfig.utf8_mode`)"
464
471
msgstr ""
472
+ "设置 :ref:`Python UTF-8 模式 <utf8-mode>` (:c:member:`PyPreConfig.utf8_mode`)"
465
473
466
474
#: ../../c-api/init_config.rst:350
467
475
msgid ""
468
476
"The current preconfiguration (``PyPreConfig`` type) is stored in "
469
477
"``_PyRuntime.preconfig``."
470
- msgstr ""
478
+ msgstr "当前的预配置 (``PyPreConfig`` 类型) 保存在 ``_PyRuntime.preconfig`` 中。 "
471
479
472
480
#: ../../c-api/init_config.rst:353
473
481
msgid "Functions to preinitialize Python:"
474
- msgstr ""
482
+ msgstr "用于预初始化 Python 的函数: "
475
483
476
484
#: ../../c-api/init_config.rst:357 ../../c-api/init_config.rst:363
477
485
#: ../../c-api/init_config.rst:372
478
486
msgid "Preinitialize Python from *preconfig* preconfiguration."
479
- msgstr ""
487
+ msgstr "根据 *preconfig* 预配置来预初始化 Python。 "
480
488
481
489
#: ../../c-api/init_config.rst:359 ../../c-api/init_config.rst:368
482
490
#: ../../c-api/init_config.rst:377
483
491
msgid "*preconfig* must not be ``NULL``."
484
- msgstr ""
492
+ msgstr "*preconfig* 不可为 ``NULL``。 "
485
493
486
494
#: ../../c-api/init_config.rst:365
487
495
msgid ""
488
496
"Parse *argv* command line arguments (bytes strings) if "
489
497
":c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero."
490
498
msgstr ""
499
+ "如果 *preconfig* 的 :c:member:`~PyPreConfig.parse_argv` 为非零值则解析 *argv* "
500
+ "命令行参数(字节串)。"
491
501
492
502
#: ../../c-api/init_config.rst:374
493
503
msgid ""
494
504
"Parse *argv* command line arguments (wide strings) if "
495
505
":c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero."
496
506
msgstr ""
507
+ "如果 *preconfig* 的 :c:member:`~PyPreConfig.parse_argv` 为非零值则解析 *argv* "
508
+ "命令行参数(宽字符串)。"
497
509
498
510
#: ../../c-api/init_config.rst:379 ../../c-api/init_config.rst:1190
499
511
msgid ""
500
512
"The caller is responsible to handle exceptions (error or exit) using "
501
513
":c:func:`PyStatus_Exception` and :c:func:`Py_ExitStatusException`."
502
514
msgstr ""
515
+ "调用方要负责使用 :c:func:`PyStatus_Exception` 和 :c:func:`Py_ExitStatusException` "
516
+ "来处理异常(错误或退出)。"
503
517
504
518
#: ../../c-api/init_config.rst:382
505
519
msgid ""
@@ -510,6 +524,10 @@ msgid ""
510
524
"like encodings. For example, the :option:`-X utf8 <-X>` command line option "
511
525
"enables the :ref:`Python UTF-8 Mode <utf8-mode>`."
512
526
msgstr ""
527
+ "对于 :ref:`Python 配置 <init-python-config>` "
528
+ "(:c:func:`PyPreConfig_InitPythonConfig`),如果 Python 是用命令行参数初始化的,那么在预初始化 "
529
+ "Python 时也必须传递命令行参数,因为它们会对编码格式等预配置产生影响。 例如,:option:`-X utf8<-X>` 命令行选项将启用 "
530
+ ":ref:`Python UTF-8 模式<utf8-mode>`。"
513
531
514
532
#: ../../c-api/init_config.rst:389
515
533
msgid ""
@@ -518,6 +536,10 @@ msgid ""
518
536
"allocator. It can be called before :c:func:`Py_PreInitialize` if "
519
537
":c:member:`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``."
520
538
msgstr ""
539
+ "``PyMem_SetAllocator()`` 可在 :c:func:`Py_PreInitialize` "
540
+ "之后、:c:func:`Py_InitializeFromConfig` 之前被调用以安装自定义的内存分配器。 如果 "
541
+ ":c:member:`PyPreConfig.allocator` 被设为 ``PYMEM_ALLOCATOR_NOT_SET`` 则可在 "
542
+ ":c:func:`Py_PreInitialize` 之前被调用。"
521
543
522
544
#: ../../c-api/init_config.rst:394
523
545
msgid ""
@@ -526,79 +548,84 @@ msgid ""
526
548
"``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must "
527
549
"not be called before the Python preinitialization."
528
550
msgstr ""
551
+ "像 :c:func:`PyMem_RawMalloc` 这样的 Python 内存分配函数不能在 Python 预初始化之前使用,而直接调用 "
552
+ "``malloc()`` 和 ``free()`` 则始终会是安全的。 :c:func:`Py_DecodeLocale` 不能在 Python "
553
+ "预初始化之前被调用。"
529
554
530
555
#: ../../c-api/init_config.rst:399
531
556
msgid ""
532
557
"Example using the preinitialization to enable the :ref:`Python UTF-8 Mode "
533
558
"<utf8-mode>`::"
534
- msgstr ""
559
+ msgstr "使用预初始化来启用 :ref:`Python UTF-8 模式 <utf8-mode>` 的例子:: "
535
560
536
561
#: ../../c-api/init_config.rst:421
537
562
msgid "PyConfig"
538
563
msgstr "PyConfig"
539
564
540
565
#: ../../c-api/init_config.rst:425
541
566
msgid "Structure containing most parameters to configure Python."
542
- msgstr ""
567
+ msgstr "包含了大部分用于配置 Python 的形参的结构体。 "
543
568
544
569
#: ../../c-api/init_config.rst:427
545
570
msgid ""
546
571
"When done, the :c:func:`PyConfig_Clear` function must be used to release the"
547
572
" configuration memory."
548
- msgstr ""
573
+ msgstr "在完成后,必须使用 :c:func:`PyConfig_Clear` 函数来释放配置内存。 "
549
574
550
575
#: ../../c-api/init_config.rst:430
551
576
msgid "Structure methods:"
552
- msgstr ""
577
+ msgstr "结构体方法: "
553
578
554
579
#: ../../c-api/init_config.rst:434
555
580
msgid ""
556
581
"Initialize configuration with the :ref:`Python Configuration <init-python-"
557
582
"config>`."
558
- msgstr ""
583
+ msgstr "通过 :ref:`Python 配置 <init-python-config>` 来初始化配置。 "
559
584
560
585
#: ../../c-api/init_config.rst:439
561
586
msgid ""
562
587
"Initialize configuration with the :ref:`Isolated Configuration <init-"
563
588
"isolated-conf>`."
564
- msgstr ""
589
+ msgstr "通过 :ref:`隔离配置 <init-isolated-conf>` 来初始化配置。 "
565
590
566
591
#: ../../c-api/init_config.rst:444
567
592
msgid "Copy the wide character string *str* into ``*config_str``."
568
- msgstr ""
593
+ msgstr "将宽字符串 *str* 拷贝至 ``*config_str``。 "
569
594
570
595
#: ../../c-api/init_config.rst:446 ../../c-api/init_config.rst:453
571
596
#: ../../c-api/init_config.rst:460 ../../c-api/init_config.rst:468
572
597
#: ../../c-api/init_config.rst:474 ../../c-api/init_config.rst:488
573
598
msgid ":ref:`Preinitialize Python <c-preinit>` if needed."
574
- msgstr ""
599
+ msgstr "在必要时 :ref:`预初始化 Python <c-preinit>`。 "
575
600
576
601
#: ../../c-api/init_config.rst:450
577
602
msgid ""
578
603
"Decode *str* using :c:func:`Py_DecodeLocale` and set the result into "
579
604
"``*config_str``."
580
- msgstr ""
605
+ msgstr "使用 :c:func:`Py_DecodeLocale` 对 *str* 进行解码并将结果设置到 ``*config_str``。 "
581
606
582
607
#: ../../c-api/init_config.rst:457
583
608
msgid ""
584
609
"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) "
585
610
"from the *argv* list of wide character strings."
586
- msgstr ""
611
+ msgstr "根据宽字符串列表 *argv* 设置命令行参数 (*config* 的 :c:member:`~PyConfig.argv` 成员)。 "
587
612
588
613
#: ../../c-api/init_config.rst:464
589
614
msgid ""
590
615
"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) "
591
616
"from the *argv* list of bytes strings. Decode bytes using "
592
617
":c:func:`Py_DecodeLocale`."
593
618
msgstr ""
619
+ "根据字节串列表 *argv* 设置命令行参数 (*config* 的 :c:member:`~PyConfig.argv` 成员)。 使用 "
620
+ ":c:func:`Py_DecodeLocale` 对字节串进行解码。"
594
621
595
622
#: ../../c-api/init_config.rst:472
596
623
msgid "Set the list of wide strings *list* to *length* and *items*."
597
- msgstr ""
624
+ msgstr "将宽字符串列表 *list* 设置为 *length* 和 *items*。 "
598
625
599
626
#: ../../c-api/init_config.rst:478
600
627
msgid "Read all Python configuration."
601
- msgstr ""
628
+ msgstr "读取所有 Python 配置。 "
602
629
603
630
#: ../../c-api/init_config.rst:480
604
631
msgid "Fields which are already initialized are left unchanged."
0 commit comments