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

Skip to content

Commit 59d4401

Browse files
[po] auto sync
1 parent 4b07101 commit 59d4401

5 files changed

Lines changed: 6902 additions & 6852 deletions

File tree

howto/logging-cookbook.po

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# 浩听 王 <[email protected]>, 2019
1111
# Shengjing Zhu <[email protected]>, 2019
1212
# Meng Du <[email protected]>, 2020
13-
# Freesand Leo <[email protected]>, 2021
1413
# Dai Xu <[email protected]>, 2021
14+
# Freesand Leo <[email protected]>, 2021
1515
#
1616
#, fuzzy
1717
msgid ""
@@ -20,7 +20,7 @@ msgstr ""
2020
"Report-Msgid-Bugs-To: \n"
2121
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
2222
"PO-Revision-Date: 2017-02-16 17:45+0000\n"
23-
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2021\n"
23+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2021\n"
2424
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2525
"MIME-Version: 1.0\n"
2626
"Content-Type: text/plain; charset=UTF-8\n"
@@ -793,6 +793,8 @@ msgid ""
793793
"special manipulation you need when its :meth:`~Filter.filter` method is "
794794
"called."
795795
msgstr ""
796+
"为日志对象添加 :class:`Filter` 或 handler,当其 :meth:`~Filter.filter` "
797+
"方法被调用时,会执行必要的定制操作。"
796798

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

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

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

824833
#: ../../howto/logging-cookbook.rst:1263
825834
msgid ""
@@ -830,6 +839,11 @@ msgid ""
830839
"signature as the :class:`~logging.LogRecord` constructor, as "
831840
":class:`LogRecord` is the default setting for the factory."
832841
msgstr ""
842+
"在 Python 3.2 以上版本中,:class:`~logging.LogRecord` "
843+
"的创建是通过工厂对象完成的,工厂对象可以指定。工厂对象只是一个可调用对象,可以用 "
844+
":func:`~logging.setLogRecordFactory` 进行设置,并用 "
845+
":func:`~logging.getLogRecordFactory` 进行查询。工厂对象的调用参数与 "
846+
":class:`~logging.LogRecord` 的构造函数相同,因为 :class:`LogRecord` 是工厂对象的默认设置。"
833847

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

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

852869
#: ../../howto/logging-cookbook.rst:1294
853870
msgid "Subclassing QueueHandler - a ZeroMQ example"
854-
msgstr ""
871+
msgstr "子类化 QueueHandler - ZeroMQ 示例 "
855872

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

863882
#: ../../howto/logging-cookbook.rst:1315
864883
msgid ""
865884
"Of course there are other ways of organizing this, for example passing in "
866885
"the data needed by the handler to create the socket::"
867-
msgstr ""
886+
msgstr "当然还有其他方案,比如通过 hander 传入所需数据,以创建 socket:"
868887

869888
#: ../../howto/logging-cookbook.rst:1333
870889
msgid "Subclassing QueueListener - a ZeroMQ example"
871-
msgstr ""
890+
msgstr "子类化 QueueListener —— ZeroMQ 示例"
872891

873892
#: ../../howto/logging-cookbook.rst:1335
874893
msgid ""
875894
"You can also subclass :class:`QueueListener` to get messages from other "
876895
"kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an "
877896
"example::"
878897
msgstr ""
898+
"你还可以子类化 :class:`QueueListener` 来从其他类型的队列中获取消息,比如从 ZeroMQ 'subscribe' 套接字。 "
899+
"下面是一个例子::"
879900

880901
#: ../../howto/logging-cookbook.rst:1354
881902
msgid "Module :mod:`logging`"
@@ -899,19 +920,19 @@ msgstr "模块 :mod:`logging.handlers`"
899920

900921
#: ../../howto/logging-cookbook.rst:1360
901922
msgid "Useful handlers included with the logging module."
902-
msgstr "日志记录模块附带的有用处理程序。"
923+
msgstr "日志记录模块中的常用 handler。"
903924

904925
#: ../../howto/logging-cookbook.rst:1362
905926
msgid ":ref:`A basic logging tutorial <logging-basic-tutorial>`"
906-
msgstr ""
927+
msgstr ":ref:`日志操作基础教程 <logging-basic-tutorial>`"
907928

908929
#: ../../howto/logging-cookbook.rst:1364
909930
msgid ":ref:`A more advanced logging tutorial <logging-advanced-tutorial>`"
910-
msgstr ""
931+
msgstr ":ref:`日志操作的高级教程 <logging-advanced-tutorial>`"
911932

912933
#: ../../howto/logging-cookbook.rst:1368
913934
msgid "An example dictionary-based configuration"
914-
msgstr ""
935+
msgstr "基于字典进行日志配置的示例"
915936

916937
#: ../../howto/logging-cookbook.rst:1370
917938
msgid ""
@@ -921,42 +942,48 @@ msgid ""
921942
"logging>`_. This dictionary is passed to :func:`~config.dictConfig` to put "
922943
"the configuration into effect::"
923944
msgstr ""
945+
"以下是日志配置字典的一个示例——它取自 Django "
946+
"项目的`文档<https://docs.djangoproject.com/en/stable/topics/logging/#configuring-"
947+
"logging>`_。此字典将被传给 :func:`~config.dictConfig` 以使配置生效:"
924948

925949
#: ../../howto/logging-cookbook.rst:1426
926950
msgid ""
927951
"For more information about this configuration, you can see the `relevant "
928952
"section <https://docs.djangoproject.com/en/stable/topics/logging"
929953
"/#configuring-logging>`_ of the Django documentation."
930954
msgstr ""
955+
"有关本配置的更多信息,请参阅 Django 文档的 `有关章节 "
956+
"<https://docs.djangoproject.com/en/stable/topics/logging/#configuring-"
957+
"logging>`_ 。"
931958

932959
#: ../../howto/logging-cookbook.rst:1433
933960
msgid "Using a rotator and namer to customize log rotation processing"
934-
msgstr ""
961+
msgstr "利用 rotator 和 namer 自定义日志轮换操作"
935962

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

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

949976
#: ../../howto/logging-cookbook.rst:1458
950977
msgid "A more elaborate multiprocessing example"
951-
msgstr ""
978+
msgstr "更详细的多进程日志示例"
952979

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

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

9741004
#: ../../howto/logging-cookbook.rst:1475
9751005
msgid ""
9761006
"Here's the script - the docstrings and the comments hopefully explain how it"
9771007
" works::"
978-
msgstr ""
1008+
msgstr "以下是代码——但愿文档字符串和注释能有助于理解其工作原理:"
9791009

9801010
#: ../../howto/logging-cookbook.rst:1687
9811011
msgid "Inserting a BOM into messages sent to a SysLogHandler"
982-
msgstr ""
1012+
msgstr "在发送给 SysLogHandler 的信息中插入一个 BOM。"
9831013

9841014
#: ../../howto/logging-cookbook.rst:1689
9851015
msgid ""

library/dataclasses.po

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ msgid ""
3939
":meth:`__repr__` to user-defined classes. It was originally described in "
4040
":pep:`557`."
4141
msgstr ""
42-
"这个模块提供了一个装饰器和一些函数,用于自动添加生成的 :term:`special method`\\s ,例如 :meth:`__init__` 和"
43-
" :meth:`__repr__` 到用户定义的类。 它最初描述于 :pep:`557` 。"
42+
"这个模块提供了一个装饰器和一些函数,用于自动添加生成的 :term:`special method`,例如 :meth:`__init__` 和 "
43+
":meth:`__repr__` 到用户定义的类。 它最初描述于 :pep:`557` 。"
4444

4545
#: ../../library/dataclasses.rst:19
4646
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

@@ -690,7 +690,7 @@ msgid ""
690690
" use :meth:`object.__setattr__`."
691691
msgstr ""
692692
"使用 ``frozen=True`` 时会有很小的性能损失: :meth:`__ init__` 不能使用简单的赋值来初始化字段,并必须使用 "
693-
":meth:`object.__ setattr__` 。"
693+
":meth:`object.__setattr__` 。"
694694

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

749749
#: ../../library/dataclasses.rst:551

0 commit comments

Comments
 (0)