File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1440,7 +1440,7 @@ msgstr "虽然上述处理方式很简单,但也给出了根据喜好对异常
14401440
14411441#: ../../howto/logging-cookbook.rst:2221
14421442msgid "Speaking logging messages"
1443- msgstr ""
1443+ msgstr "语音播报日志信息 "
14441444
14451445#: ../../howto/logging-cookbook.rst:2223
14461446msgid ""
@@ -1458,19 +1458,23 @@ msgid ""
14581458"other handlers to be kept waiting. Here is a short example showing the "
14591459"approach, which assumes that the ``espeak`` TTS package is available::"
14601460msgstr ""
1461+ "有时可能需要以声音的形式呈现日志消息。如果系统自带了文本转语音 (TTS)功能,即便没与 Python 关联也很容易做到。大多数 TTS "
1462+ "系统都有一个可运行的命令行程序,在 handler 中可以用 :mod:`subprocess` 进行调用。这里假定 TTS "
1463+ "命令行程序不会与用户交互,或需要很长时间才会执行完毕,写入日志的信息也不会多到影响用户查看,并且可以接受每次播报一条信息,以下示例实现了等一条信息播完再处理下一条,可能会导致其他"
1464+ " handler 的等待。这个简短示例仅供演示,假定 ``espeak`` TTS 包已就绪:"
14611465
14621466#: ../../howto/logging-cookbook.rst:2265
14631467msgid ""
14641468"When run, this script should say \" Hello\" and then \" Goodbye\" in a female "
14651469"voice."
1466- msgstr ""
1470+ msgstr "运行后将会以女声播报“Hello”和“Goodbye”。 "
14671471
14681472#: ../../howto/logging-cookbook.rst:2267
14691473msgid ""
14701474"The above approach can, of course, be adapted to other TTS systems and even "
14711475"other systems altogether which can process messages via external programs "
14721476"run from a command line."
1473- msgstr ""
1477+ msgstr "当然,上述方案也适用于其他 TTS 系统,甚至可以通过利用命令行运行的外部程序来处理消息。 "
14741478
14751479#: ../../howto/logging-cookbook.rst:2275
14761480msgid "Buffering logging messages and outputting them conditionally"
You can’t perform that action at this time.
0 commit comments