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

Skip to content

Commit d6e9b99

Browse files
[po] auto sync
1 parent 4d5e3c5 commit d6e9b99

3 files changed

Lines changed: 42 additions & 11 deletions

File tree

library/io.po

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,14 @@ msgid ""
189189
"platforms use UTF-8 locale by default. This causes bugs because the locale "
190190
"encoding is not UTF-8 for most Windows users. For example::"
191191
msgstr ""
192+
"但是,很多开发者在打开以 UTF-8 编码的文本文件 (例如 JSON, TOML, Markdown 等等...) 时会忘记指定编码格式,因为大多数 "
193+
"Unix 平台默认使用 UTF-8 语言区域。 这会导致各种错误因为大多数 Windows 用户的语言区域编码格式并不是 UTF-8。 例如::"
192194

193195
#: ../../library/io.rst:126
194196
msgid ""
195197
"Additionally, while there is no concrete plan as of yet, Python may change "
196198
"the default text file encoding to UTF-8 in the future."
197-
msgstr ""
199+
msgstr "此外,虽然暂时还没有确定的计划,但 Python 可能会在未来将默认的文本文件编码格式改为 UTF-8。"
198200

199201
#: ../../library/io.rst:129
200202
msgid ""
@@ -203,21 +205,25 @@ msgid ""
203205
"``encoding=\"utf-8\"``. To use the current locale encoding, "
204206
"``encoding=\"locale\"`` is supported in Python 3.10."
205207
msgstr ""
208+
"为此,强烈建议你在打开文本文件时显式地指定编码格式。 如果你想要使用 UTF-8,请传入 ``encoding=\"utf-8\"``。 "
209+
"要使用当前语言区域的编码格式,``encoding=\"locale\"`` 已在 Python 3.10 中被支持。"
206210

207211
#: ../../library/io.rst:134
208212
msgid ""
209213
"When you need to run existing code on Windows that attempts to opens UTF-8 "
210214
"files using the default locale encoding, you can enable the UTF-8 mode. See "
211215
":ref:`UTF-8 mode on Windows <win-utf8-mode>`."
212216
msgstr ""
217+
"当你需要在 Windows 上运行尝试使用默认语言区域的编码格式打开使用 UTF-8 的文件的现有代码时,你可以启动 UTF-8 模式。 参见 "
218+
":ref:`Windows 上的 UTF-8 模式 <win-utf8-mode>`。"
213219

214220
#: ../../library/io.rst:141
215221
msgid "Opt-in EncodingWarning"
216-
msgstr ""
222+
msgstr "选择性的 EncodingWarning"
217223

218224
#: ../../library/io.rst:143
219225
msgid "See :pep:`597` for more details."
220-
msgstr ""
226+
msgstr "请参阅 :pep:`597` 了解详情。"
221227

222228
#: ../../library/io.rst:146
223229
msgid ""
@@ -226,6 +232,9 @@ msgid ""
226232
":envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an"
227233
" :exc:`EncodingWarning` when the default encoding is used."
228234
msgstr ""
235+
"要找出哪里使用了默认语言区域的编码格式,你可以启用 ``-X warn_default_encoding`` 命令行选项或设置 "
236+
":envvar:`PYTHONWARNDEFAULTENCODING` 环境变量,这将在使用默认编码格式时发出 "
237+
":exc:`EncodingWarning`。"
229238

230239
#: ../../library/io.rst:151
231240
msgid ""
@@ -235,6 +244,10 @@ msgid ""
235244
":exc:`EncodingWarning` if they don't pass an ``encoding``. However, please "
236245
"consider using UTF-8 by default (i.e. ``encoding=\"utf-8\"``) for new APIs."
237246
msgstr ""
247+
"如果你提供了使用 :func:`open` 或 :class:`TextIOWrapper` 的 API 并将 ``encoding=None`` "
248+
"作为形参传入,你可以使用 :func:`text_encoding` 以便 API 的调用方在没有传入 ``encoding`` 的时候将发出 "
249+
":exc:`EncodingWarning`。 但是,对于新的 API 请考虑默认就使用 UTF-8 (即 "
250+
"``encoding=\"utf-8\"``)。"
238251

239252
#: ../../library/io.rst:160
240253
msgid "High-level Module Interface"
@@ -295,29 +308,35 @@ msgid ""
295308
"This is a helper function for callables that use :func:`open` or "
296309
":class:`TextIOWrapper` and have an ``encoding=None`` parameter."
297310
msgstr ""
311+
"这是一个针对使用 :func:`open` 或 :class:`TextIOWrapper` 的可调用对象的辅助函数并且具有 "
312+
"``encoding=None`` 形参。"
298313

299314
#: ../../library/io.rst:201
300315
msgid ""
301316
"This function returns *encoding* if it is not ``None`` and ``\"locale\"`` if"
302317
" *encoding* is ``None``."
303318
msgstr ""
319+
"此函数会返回 *encoding*,如果它不为 ``None`` 的话,或是 ``\"locale\"`` ,如果 *encoding* 为 "
320+
"``None`` 的话。"
304321

305322
#: ../../library/io.rst:204
306323
msgid ""
307324
"This function emits an :class:`EncodingWarning` if "
308325
":data:`sys.flags.warn_default_encoding <sys.flags>` is true and *encoding* "
309326
"is None. *stacklevel* specifies where the warning is emitted. For example::"
310327
msgstr ""
328+
"如果 :data:`sys.flags.warn_default_encoding <sys.flags>` 为真值并且 *encoding* 为 "
329+
"None 则此函数会发出 :class:`EncodingWarning`。 *stacklevel* 指定在哪里发出警告。 例如::"
311330

312331
#: ../../library/io.rst:214
313332
msgid ""
314333
"In this example, an :class:`EncodingWarning` is emitted for the caller of "
315334
"``read_text()``."
316-
msgstr ""
335+
msgstr "在这个例子中,将为 ``read_text()`` 的调用方发出 :class:`EncodingWarning`。"
317336

318337
#: ../../library/io.rst:217
319338
msgid "See :ref:`io-text-encoding` for more information."
320-
msgstr ""
339+
msgstr "请参阅 :ref:`io-text-encoding` 了解更多信息。"
321340

322341
#: ../../library/io.rst:224
323342
msgid ""
@@ -1471,6 +1490,10 @@ msgid ""
14711490
"specify the current locale's encoding explicitly. See :ref:`io-text-"
14721491
"encoding` for more information."
14731492
msgstr ""
1493+
"*encoding* 给出流的解码和编码将会使用的编码格式的名称。 它默认为 "
1494+
":func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`。 "
1495+
"``encoding=\"locale\"`` 可被用来地指定当前语言区域的编码格式。 请参阅 :ref:`io-text-encoding` "
1496+
"了解更多信息。"
14741497

14751498
#: ../../library/io.rst:954
14761499
msgid ""
@@ -1562,7 +1585,7 @@ msgstr ""
15621585
#: ../../library/io.rst:1004
15631586
msgid ""
15641587
"The *encoding* argument now supports the ``\"locale\"`` dummy encoding name."
1565-
msgstr ""
1588+
msgstr "*encoding* 参数现在支持 ``\"locale\"`` 作为编码格式名称。"
15661589

15671590
#: ../../library/io.rst:1007
15681591
msgid ""

tutorial/controlflow.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ msgid ""
6767
"specific types or attributes, you may also find the :keyword:`!match` "
6868
"statement useful. For more details see :ref:`tut-match`."
6969
msgstr ""
70+
"如果你要将同一个值与多个常量进行比较,或是要检查特定类型或属性,你可能会发现 :keyword:`!match` 语句是很有用的。 更多细节请参阅 "
71+
":ref:`tut-match`。"
7072

7173
#: ../../tutorial/controlflow.rst:46
7274
msgid ":keyword:`!for` Statements"
@@ -235,7 +237,7 @@ msgstr ""
235237

236238
#: ../../tutorial/controlflow.rst:251
237239
msgid ":keyword:`!match` Statements"
238-
msgstr ""
240+
msgstr ":keyword:`!match` 语句"
239241

240242
#: ../../tutorial/controlflow.rst:253
241243
msgid ""
@@ -245,17 +247,21 @@ msgid ""
245247
" it can also extract components (sequence elements or object attributes) "
246248
"from the value into variables."
247249
msgstr ""
250+
"match 语句接受一个表达式并将它的值与以一个或多个 case 语句块形式给出的一系列模式进行比较。 这在表面上很类似 C, Java 或 "
251+
"JavaScript (以及许多其他语言) 中的 switch 语句,但它还能够从值中提取子部分 (序列元素或对象属性) 并赋值给变量。"
248252

249253
#: ../../tutorial/controlflow.rst:259
250254
msgid ""
251255
"The simplest form compares a subject value against one or more literals::"
252-
msgstr ""
256+
msgstr "最简单的形式是将一个目标值与一个或多个字面值进行比较::"
253257

254258
#: ../../tutorial/controlflow.rst:272
255259
msgid ""
256260
"Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and "
257261
"never fails to match. If no case matches, none of the branches is executed."
258262
msgstr ""
263+
"请注意最后一个代码块: \"变量名\" ``_`` 被作为 *通配符* 并必定会匹配成功。 如果没有任何 case "
264+
"语句匹配成功,则任何分支都不会被执行。"
259265

260266
#: ../../tutorial/controlflow.rst:275
261267
msgid ""
@@ -266,7 +272,7 @@ msgstr "你可以使用 ``|`` (“ or ”)在一个模式中组合几个字
266272
msgid ""
267273
"Patterns can look like unpacking assignments, and can be used to bind "
268274
"variables::"
269-
msgstr ""
275+
msgstr "模式的形式可以类似于解包赋值,并可被用于绑定变量::"
270276

271277
#: ../../tutorial/controlflow.rst:296
272278
msgid ""
@@ -277,13 +283,15 @@ msgid ""
277283
" which makes it conceptually similar to the unpacking assignment ``(x, y) = "
278284
"point``."
279285
msgstr ""
286+
"请仔细研究此代码! 第一个模式有两个字面值,可以看作是上面所示字面值模式的扩展。 但接下来的两个模式结合了一个字面值和一个变量,而变量 *绑定* "
287+
"了一个来自目标的值 (``point``)。 第四个模式捕获了两个值,这使得它在概念上类似于解包赋值 ``(x, y) = point``。"
280288

281289
#: ../../tutorial/controlflow.rst:303
282290
msgid ""
283291
"If you are using classes to structure your data you can use the class name "
284292
"followed by an argument list resembling a constructor, but with the ability "
285293
"to capture attributes into variables::"
286-
msgstr ""
294+
msgstr "如果你使用类来结构化你的数据,你可以使用类名之后跟一个类似于构造器的参数列表,这样能够捕获属性放入到变量中::"
287295

288296
#: ../../tutorial/controlflow.rst:324
289297
msgid ""

whatsnew/3.10.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ msgstr ""
761761

762762
#: ../../whatsnew/3.10.rst:712
763763
msgid "See :ref:`io-text-encoding` for more information."
764-
msgstr ""
764+
msgstr "请参阅 :ref:`io-text-encoding` 了解更多信息。"
765765

766766
#: ../../whatsnew/3.10.rst:716
767767
msgid "New Features Related to Type Hints"

0 commit comments

Comments
 (0)