Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ab5682

Browse files
[po] auto sync
1 parent 8798940 commit 7ab5682

3 files changed

Lines changed: 58 additions & 32 deletions

File tree

howto/logging-cookbook.po

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
#
66
# Translators:
77
# ww song <[email protected]>, 2019
8-
# Freesand Leo <[email protected]>, 2019
98
# 欢 王 <[email protected]>, 2019
109
# 非法操作 <[email protected]>, 2019
1110
# MuSheng Chen <[email protected]>, 2019
1211
# 浩听 王 <[email protected]>, 2019
1312
# Shengjing Zhu <[email protected]>, 2019
1413
# Meng Du <[email protected]>, 2020
1514
# Dai Xu <[email protected]>, 2021
15+
# Freesand Leo <[email protected]>, 2021
1616
#
1717
#, fuzzy
1818
msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121
"Report-Msgid-Bugs-To: \n"
2222
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
2323
"PO-Revision-Date: 2019-09-01 03:37+0000\n"
24-
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2021\n"
24+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2021\n"
2525
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2626
"MIME-Version: 1.0\n"
2727
"Content-Type: text/plain; charset=UTF-8\n"
@@ -781,13 +781,17 @@ msgid ""
781781
":meth:`Logger.makeRecord`, and set it using :func:`~logging.setLoggerClass` "
782782
"before any loggers that you care about are instantiated."
783783
msgstr ""
784+
"创建 :class:`Logger`  自定义子类,重写 :meth:`Logger.makeRecord`,并在实例化所需日志对象之前用 "
785+
":func:`~logging.setLoggerClass` 进行设置。"
784786

785787
#: ../../howto/logging-cookbook.rst:1241
786788
msgid ""
787789
"Add a :class:`Filter` to a logger or handler, which does the necessary "
788790
"special manipulation you need when its :meth:`~Filter.filter` method is "
789791
"called."
790792
msgstr ""
793+
"为日志对象添加 :class:`Filter` 或 handler,当其 :meth:`~Filter.filter` "
794+
"方法被调用时,会执行必要的定制操作。"
791795

792796
#: ../../howto/logging-cookbook.rst:1245
793797
msgid ""
@@ -796,6 +800,8 @@ msgid ""
796800
"attempt to set its own :class:`Logger` subclass, and the one which did this "
797801
"last would win."
798802
msgstr ""
803+
"比如说在有多个不同库要完成不同操作的场景下,第一种方式会有点笨拙。 每次都要尝试设置自己的 :class:`Logger` "
804+
"子类,而起作用的是最后一次尝试。"
799805

800806
#: ../../howto/logging-cookbook.rst:1250
801807
msgid ""
@@ -805,6 +811,8 @@ msgid ""
805811
"to remember to do this every time they introduced a new logger (which they "
806812
"would do simply by adding new packages or modules and doing ::"
807813
msgstr ""
814+
"第二种方式在多数情况下效果都比较良好,但不允许你使用特殊化的 :class:`LogRecord` 子类。 "
815+
"库开发者可以为他们的日志记录器设置合适的过滤器,但他们应当要记得每次引入新的日志记录器时都需如此(他们只需通过添加新的包或模块并执行以下操作即可)::"
808816

809817
#: ../../howto/logging-cookbook.rst:1258
810818
msgid ""
@@ -815,6 +823,9 @@ msgid ""
815823
" so output from that handler would not reflect the intentions of the library"
816824
" developer."
817825
msgstr ""
826+
"或许这样要顾及太多事情。开发人员还可以将过滤器附加到其顶级日志对象的 :class:`~logging.NullHandler` "
827+
"中,但如果应用程序开发人员将 handler 附加到较底层库的日志对象,则不会调用该过滤器 --- 所以 handler "
828+
"输出的内容不会符合库开发人员的预期。 "
818829

819830
#: ../../howto/logging-cookbook.rst:1264
820831
msgid ""
@@ -825,6 +836,11 @@ msgid ""
825836
"signature as the :class:`~logging.LogRecord` constructor, as "
826837
":class:`LogRecord` is the default setting for the factory."
827838
msgstr ""
839+
"在 Python 3.2 以上版本中,:class:`~logging.LogRecord` "
840+
"的创建是通过工厂对象完成的,工厂对象可以指定。工厂对象只是一个可调用对象,可以用 "
841+
":func:`~logging.setLogRecordFactory` 进行设置,并用 "
842+
":func:`~logging.getLogRecordFactory` 进行查询。工厂对象的调用参数与 "
843+
":class:`~logging.LogRecord` 的构造函数相同,因为 :class:`LogRecord` 是工厂对象的默认设置。"
828844

829845
#: ../../howto/logging-cookbook.rst:1271
830846
msgid ""
@@ -833,6 +849,7 @@ msgid ""
833849
"additional attributes to the record once created, using a pattern similar to"
834850
" this::"
835851
msgstr ""
852+
"这种方式可以让自定义工厂对象完全控制 LogRecord 的创建过程。比如可以返回一个子类,或者在创建的日志对象中加入一些额外的属性,使用方式如下所示:"
836853

837854
#: ../../howto/logging-cookbook.rst:1284
838855
msgid ""
@@ -843,34 +860,40 @@ msgid ""
843860
"time overhead to all logging operations, and the technique should only be "
844861
"used when the use of a :class:`Filter` does not provide the desired result."
845862
msgstr ""
863+
"这种模式允许不同的库将多个工厂对象链在一起,只要不会覆盖彼此的属性或标准属性,就不会出现意外。但应记住,工厂链中的每个节点都会增加日志操作的运行开销,本技术仅在采用"
864+
" :class:`Filter` 无法达到目标时才应使用。 "
846865

847866
#: ../../howto/logging-cookbook.rst:1295
848867
msgid "Subclassing QueueHandler - a ZeroMQ example"
849-
msgstr ""
868+
msgstr "子类化 QueueHandler - ZeroMQ 示例 "
850869

851870
#: ../../howto/logging-cookbook.rst:1297
852871
msgid ""
853872
"You can use a :class:`QueueHandler` subclass to send messages to other kinds"
854873
" of queues, for example a ZeroMQ 'publish' socket. In the example below,the "
855874
"socket is created separately and passed to the handler (as its 'queue')::"
856875
msgstr ""
876+
"你可以使用 :class:`QueueHandler` 子类将消息发送给其他类型的队列 ,比如 ZeroMQ 'publish' 套接字。 "
877+
"在以下示例中,套接字将单独创建并传给处理句柄 (作为它的 'queue')::"
857878

858879
#: ../../howto/logging-cookbook.rst:1316
859880
msgid ""
860881
"Of course there are other ways of organizing this, for example passing in "
861882
"the data needed by the handler to create the socket::"
862-
msgstr ""
883+
msgstr "当然还有其他方案,比如通过 hander 传入所需数据,以创建 socket:"
863884

864885
#: ../../howto/logging-cookbook.rst:1334
865886
msgid "Subclassing QueueListener - a ZeroMQ example"
866-
msgstr ""
887+
msgstr "子类化 QueueListener —— ZeroMQ 示例"
867888

868889
#: ../../howto/logging-cookbook.rst:1336
869890
msgid ""
870891
"You can also subclass :class:`QueueListener` to get messages from other "
871892
"kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an "
872893
"example::"
873894
msgstr ""
895+
"你还可以子类化 :class:`QueueListener` 来从其他类型的队列中获取消息,比如从 ZeroMQ 'subscribe' 套接字。 "
896+
"下面是一个例子::"
874897

875898
#: ../../howto/logging-cookbook.rst:1355
876899
msgid "Module :mod:`logging`"
@@ -898,15 +921,15 @@ msgstr "日志记录模块附带的有用处理程序。"
898921

899922
#: ../../howto/logging-cookbook.rst:1363
900923
msgid ":ref:`A basic logging tutorial <logging-basic-tutorial>`"
901-
msgstr ""
924+
msgstr ":ref:`日志操作基础教程 <logging-basic-tutorial>`"
902925

903926
#: ../../howto/logging-cookbook.rst:1365
904927
msgid ":ref:`A more advanced logging tutorial <logging-advanced-tutorial>`"
905-
msgstr ""
928+
msgstr ":ref:`日志操作的高级教程 <logging-advanced-tutorial>`"
906929

907930
#: ../../howto/logging-cookbook.rst:1369
908931
msgid "An example dictionary-based configuration"
909-
msgstr ""
932+
msgstr "基于字典进行日志配置的示例"
910933

911934
#: ../../howto/logging-cookbook.rst:1371
912935
msgid ""
@@ -926,32 +949,32 @@ msgstr ""
926949

927950
#: ../../howto/logging-cookbook.rst:1434
928951
msgid "Using a rotator and namer to customize log rotation processing"
929-
msgstr ""
952+
msgstr "利用 rotator 和 namer 自定义日志轮换操作"
930953

931954
#: ../../howto/logging-cookbook.rst:1436
932955
msgid ""
933956
"An example of how you can define a namer and rotator is given in the "
934957
"following snippet, which shows zlib-based compression of the log file::"
935-
msgstr ""
958+
msgstr "以下代码给出了定义 namer 和 rotator 的示例,其中演示了基于 zlib 的日志文件压缩过程:"
936959

937960
#: ../../howto/logging-cookbook.rst:1454
938961
msgid ""
939962
"These are not \"true\" .gz files, as they are bare compressed data, with no "
940963
"\"container\" such as you’d find in an actual gzip file. This snippet is "
941964
"just for illustration purposes."
942-
msgstr ""
965+
msgstr "这些不是“真正的” .gz 文件,因为他们只是纯压缩数据,缺少真正 gzip 文件中的“容器”。此段代码只是用于演示。 "
943966

944967
#: ../../howto/logging-cookbook.rst:1459
945968
msgid "A more elaborate multiprocessing example"
946-
msgstr ""
969+
msgstr "更加详细的多道处理示例"
947970

948971
#: ../../howto/logging-cookbook.rst:1461
949972
msgid ""
950973
"The following working example shows how logging can be used with "
951974
"multiprocessing using configuration files. The configurations are fairly "
952975
"simple, but serve to illustrate how more complex ones could be implemented "
953976
"in a real multiprocessing scenario."
954-
msgstr ""
977+
msgstr "以下可运行的示例显示了如何利用配置文件在多进程中应用日志。这些配置相当简单,但足以说明如何在真实的多进程场景中实现较为复杂的配置。 "
955978

956979
#: ../../howto/logging-cookbook.rst:1466
957980
msgid ""
@@ -965,16 +988,19 @@ msgid ""
965988
" purely illustrative, but you should be able to adapt this example to your "
966989
"own scenario."
967990
msgstr ""
991+
"上述示例中,主进程产生一个侦听器进程和一些工作进程。每个主进程、侦听器进程和工作进程都有三种独立的日志配置(工作进程共享同一套配置)。大家可以看到主进程的日志记录过程、工作线程向"
992+
" QueueHandler 写入日志的过程,以及侦听器实现 QueueListener 和较为复杂的日志配置,如何将由队列接收到的事件分发给配置指定的 "
993+
"handler。请注意,这些配置纯粹用于演示,但应该能调整代码以适用于自己的场景。"
968994

969995
#: ../../howto/logging-cookbook.rst:1476
970996
msgid ""
971997
"Here's the script - the docstrings and the comments hopefully explain how it"
972998
" works::"
973-
msgstr ""
999+
msgstr "以下是代码——但愿文档字符串和注释能有助于理解其工作原理:"
9741000

9751001
#: ../../howto/logging-cookbook.rst:1688
9761002
msgid "Inserting a BOM into messages sent to a SysLogHandler"
977-
msgstr ""
1003+
msgstr "在发送给 SysLogHandler 的信息中插入一个 BOM。"
9781004

9791005
#: ../../howto/logging-cookbook.rst:1690
9801006
msgid ""

library/dataclasses.po

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ww song <[email protected]>, 2019
99
# Meng Du <[email protected]>, 2019
1010
# nick <[email protected]>, 2019
11-
# Freesand Leo <[email protected]>, 2019
11+
# Freesand Leo <[email protected]>, 2021
1212
#
1313
#, fuzzy
1414
msgid ""
@@ -17,7 +17,7 @@ msgstr ""
1717
"Report-Msgid-Bugs-To: \n"
1818
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
1919
"PO-Revision-Date: 2019-09-01 03:22+0000\n"
20-
"Last-Translator: Freesand Leo <[email protected]>, 2019\n"
20+
"Last-Translator: Freesand Leo <[email protected]>, 2021\n"
2121
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2222
"MIME-Version: 1.0\n"
2323
"Content-Type: text/plain; charset=UTF-8\n"
@@ -40,8 +40,8 @@ msgid ""
4040
":meth:`__repr__` to user-defined classes. It was originally described in "
4141
":pep:`557`."
4242
msgstr ""
43-
"这个模块提供了一个装饰器和一些函数,用于自动添加生成的 :term:`special method`\\s ,例如 :meth:`__init__` 和"
44-
" :meth:`__repr__` 到用户定义的类。 它最初描述于 :pep:`557` 。"
43+
"这个模块提供了一个装饰器和一些函数,用于自动添加生成的 :term:`special method`,例如 :meth:`__init__` 和 "
44+
":meth:`__repr__` 到用户定义的类。 它最初描述于 :pep:`557` 。"
4545

4646
#: ../../library/dataclasses.rst:19
4747
msgid ""
@@ -113,12 +113,12 @@ msgstr ":func:`dataclass` 的参数有:"
113113
msgid ""
114114
"``init``: If true (the default), a :meth:`__init__` method will be "
115115
"generated."
116-
msgstr "``init``: 如果为真值(默认),将生成一个 :meth:`__ init__` 方法。"
116+
msgstr "``init``: 如果为真值(默认),将生成一个 :meth:`__init__` 方法。"
117117

118118
#: ../../library/dataclasses.rst:91
119119
msgid ""
120120
"If the class already defines :meth:`__init__`, this parameter is ignored."
121-
msgstr "如果类已定义 :meth:`__ init__` ,则忽略此参数。"
121+
msgstr "如果类已定义 :meth:`__init__` ,则忽略此参数。"
122122

123123
#: ../../library/dataclasses.rst:94
124124
msgid ""
@@ -160,7 +160,7 @@ msgid ""
160160
"order. Both instances in the comparison must be of the identical type. If "
161161
"``order`` is true and ``eq`` is false, a :exc:`ValueError` is raised."
162162
msgstr ""
163-
"``order`` :如果为真值(默认为 ``False`` ),则 :meth:`__lt__` 、 :meth:`__ le__` 、 "
163+
"``order`` :如果为真值(默认为 ``False`` ),则 :meth:`__lt__` 、 :meth:`__le__` 、 "
164164
":meth:`__gt__` 和 :meth:`__ge__` 方法将生成。 这将类作为其字段的元组按顺序比较。比较中的两个实例必须是相同的类型。如果 "
165165
"``order`` 为真值并且 ``eq`` 为假值 ,则引发 :exc:`ValueError` 。"
166166

@@ -577,8 +577,8 @@ msgid ""
577577
msgstr ""
578578
"生成的 :meth:`__init__` 代码将调用一个名为 :meth:`__post_init__` 的方法,如果在类上已经定义了 "
579579
":meth:`__post_init__` 。它通常被称为 ``self.__post_init__()`` 。但是,如果定义了任何 "
580-
"``InitVar`` 字段,它们也将按照它们在类中定义的顺序传递给 :meth:`__post_init__` 。 如果没有 :meth:`__ "
581-
"init__` 方法生成,那么 :meth:`__post_init__` 将不会被自动调用。"
580+
"``InitVar`` 字段,它们也将按照它们在类中定义的顺序传递给 :meth:`__post_init__` 。 如果没有 "
581+
":meth:`__init__` 方法生成,那么 :meth:`__post_init__` 将不会被自动调用。"
582582

583583
#: ../../library/dataclasses.rst:413
584584
msgid ""
@@ -670,8 +670,8 @@ msgid ""
670670
":meth:`__init__` cannot use simple assignment to initialize fields, and must"
671671
" use :meth:`object.__setattr__`."
672672
msgstr ""
673-
"使用 ``frozen=True`` 时会有很小的性能损失: :meth:`__ init__` 不能使用简单的赋值来初始化字段,并必须使用 "
674-
":meth:`object.__ setattr__` 。"
673+
"使用 ``frozen=True`` 时会有很小的性能损失: :meth:`__init__` 不能使用简单的赋值来初始化字段,并必须使用 "
674+
":meth:`object.__setattr__`。"
675675

676676
#: ../../library/dataclasses.rst:485
677677
msgid "Inheritance"
@@ -724,7 +724,7 @@ msgid ""
724724
"happens because there is no other way to give the field an initial value."
725725
msgstr ""
726726
"如果一个字段被排除在 :meth:`__init__` 之外(使用 ``init=False`` )并且字段也指定 "
727-
"``default_factory`` ,则默认的工厂函数将始终从生成的 :meth:`__ init__` "
727+
"``default_factory`` ,则默认的工厂函数将始终从生成的 :meth:`__init__` "
728728
"函数调用。发生这种情况是因为没有其他方法可以为字段提供初始值。"
729729

730730
#: ../../library/dataclasses.rst:530

library/site.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ msgstr ""
2626

2727
#: ../../library/site.rst:2
2828
msgid ":mod:`site` --- Site-specific configuration hook"
29-
msgstr ":mod:`site` —— 指定 Site 的配置钩子"
29+
msgstr ":mod:`site` —— 站点专属的配置钩子"
3030

3131
#: ../../library/site.rst:7
3232
msgid "**Source code:** :source:`Lib/site.py`"
@@ -47,15 +47,15 @@ msgid ""
4747
"module search path or additions to the builtins. To explicitly trigger the "
4848
"usual site-specific additions, call the :func:`site.main` function."
4949
msgstr ""
50-
"导入此模块将会附加域特定的路径到模块搜索路径并且添加一些内建对象,除非使用了 :option:`-S` "
51-
"选项。在此例中,模块可以被安全地导入,而不会对模块搜索路径和内建对象有自动的修改或添加。要明确地触发通常域特定的添加,调用函数 "
52-
":func:`site.main`。"
50+
"导入此模块将会附加站点专属的路径到模块搜索路径并且添加一些内建对象,除非使用了 :option:`-S` "
51+
"选项。在此例中,模块可以被安全地导入,而不会对模块搜索路径和内建对象有自动的修改或添加。要明确地触发通常的站点专属添加,请调用 "
52+
":func:`site.main` 函数。"
5353

5454
#: ../../library/site.rst:24
5555
msgid ""
5656
"Importing the module used to trigger paths manipulation even when using "
5757
":option:`-S`."
58-
msgstr "即便使用了 :option:`-S`,也会导入用于触发路径操纵的模块。"
58+
msgstr "在之前即便使用了 :option:`-S`,导入此模块仍然会触发路径操纵。"
5959

6060
#: ../../library/site.rst:31
6161
msgid ""

0 commit comments

Comments
 (0)