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

Skip to content

Commit bac086c

Browse files
[po] auto sync
1 parent bc0c6fc commit bac086c

3 files changed

Lines changed: 54 additions & 18 deletions

File tree

howto/urllib2.po

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ msgid ""
362362
"also has read, geturl, and info, methods as returned by the "
363363
"``urllib.response`` module::"
364364
msgstr ""
365+
"当触发错误时,服务器通过返回 HTTP 错误码 *和* 错误页面进行响应。可以将 :exc:`HTTPError` 实例用作返回页面的响应。这意味着除了"
366+
" code 属性之外,错误对象还像 ``urllib.response`` 模块返回的那样具有 read、geturl 和 info 方法: "
365367

366368
#: ../../howto/urllib2.rst:346
367369
msgid "Wrapping it Up"
@@ -371,7 +373,7 @@ msgstr "包装起来"
371373
msgid ""
372374
"So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` "
373375
"there are two basic approaches. I prefer the second approach."
374-
msgstr ""
376+
msgstr "若要准备处理 :exc:`HTTPError`  *或* :exc:`URLError` ,有两种简单的方案。推荐使用第二种方案。"
375377

376378
#: ../../howto/urllib2.rst:352
377379
msgid "Number 1"
@@ -382,10 +384,12 @@ msgid ""
382384
"The ``except HTTPError`` *must* come first, otherwise ``except URLError`` "
383385
"will *also* catch an :exc:`HTTPError`."
384386
msgstr ""
387+
"``except HTTPError`` *必须* 首先处理,否则 ``except URLError`` 将会 *同时* 捕获 "
388+
":exc:`HTTPError` 。"
385389

386390
#: ../../howto/urllib2.rst:378
387391
msgid "Number 2"
388-
msgstr ""
392+
msgstr "第二种方案"
389393

390394
#: ../../howto/urllib2.rst:399
391395
msgid "info and geturl"
@@ -429,7 +433,7 @@ msgstr ""
429433

430434
#: ../../howto/urllib2.rst:420
431435
msgid "Openers and Handlers"
432-
msgstr ""
436+
msgstr "Opener 和 Handler"
433437

434438
#: ../../howto/urllib2.rst:422
435439
msgid ""
@@ -441,13 +445,19 @@ msgid ""
441445
"(http, ftp, etc.), or how to handle an aspect of URL opening, for example "
442446
"HTTP redirections or HTTP cookies."
443447
msgstr ""
448+
"当获取 URL 时,会用到了一个 opener(一个类名可能经过混淆的 :class:`urllib.request.OpenerDirector` "
449+
"的实例)。通常一直会用默认的 opener ——通过 ``urlopen`` ——但也可以创建自定义的 opener 。opener 会用到 "
450+
"handler。所有的“繁重工作”都由 handler 完成。每种 handler 知道某种 URL 方案(http、ftp 等)的 URL "
451+
"的打开方式,或是某方面 URL 的打开方式,例如 HTTP 重定向或 HTTP cookie。 "
444452

445453
#: ../../howto/urllib2.rst:430
446454
msgid ""
447455
"You will want to create openers if you want to fetch URLs with specific "
448456
"handlers installed, for example to get an opener that handles cookies, or to"
449457
" get an opener that does not handle redirections."
450458
msgstr ""
459+
"若要用已安装的某个 handler 获取 URL,需要创建一个 opener 对象,例如处理 cookie 的 handler,或对重定向不做处理的 "
460+
"handler。"
451461

452462
#: ../../howto/urllib2.rst:434
453463
msgid ""

library/urllib.request.po

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# nick <[email protected]>, 2019
88
# ppcfish <[email protected]>, 2019
99
# 汪心禾 <[email protected]>, 2020
10-
# Freesand Leo <[email protected]>, 2021
1110
# Dai Xu <[email protected]>, 2021
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:31+0000\n"
20-
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2021\n"
20+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 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"
@@ -366,6 +366,11 @@ msgid ""
366366
"Firefox/2.0.0.11\"``, while :mod:`urllib`'s default user agent string is "
367367
"``\"Python-urllib/2.6\"`` (on Python 2.6)."
368368
msgstr ""
369+
"*headers* 应为字典对象,视同于用每个键和值作为参数去调用 :meth:`add_header`。 通常用于 ``User-Agent`` "
370+
"头部数据的“伪装” ,浏览器用这些头部数据标识自己——某些 HTTP 服务器只允许来自普通浏览器的请求,而不接受来自脚本的请求。例如,Mozilla "
371+
"Firefox 可能将自己标识为 ``\"Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 "
372+
"Firefox/2.0.0.11\"``,而 :mod:`urllib` 的默认用户代理字符串则是 ``\"Python-urllib/2.6\"`` "
373+
"(在 Python 2.6 上)。"
369374

370375
#: ../../library/urllib.request.rst:218
371376
msgid ""
@@ -374,12 +379,14 @@ msgid ""
374379
" None, ``Content-Type: application/x-www-form-urlencoded`` will be added as "
375380
"a default."
376381
msgstr ""
382+
"如果给出了 *data* 参数,则应当包含合适的 ``Content-Type`` 头部信息。若未提供且 *data* 不是 None,则会把 "
383+
"``Content-Type: application/x-www-form-urlencoded`` 加入作为默认值。 "
377384

378385
#: ../../library/urllib.request.rst:223
379386
msgid ""
380387
"The next two arguments are only of interest for correct handling of third-"
381388
"party HTTP cookies:"
382-
msgstr ""
389+
msgstr "接下来的两个参数,只对第三方 HTTP cookie 的处理才有用:"
383390

384391
#: ../../library/urllib.request.rst:226
385392
msgid ""
@@ -390,6 +397,9 @@ msgid ""
390397
"request is for an image in an HTML document, this should be the request-host"
391398
" of the request for the page containing the image."
392399
msgstr ""
400+
"*origin_req_host* 应为发起初始会话的请求主机,定义参见 :rfc:`2965` "
401+
"。默认指为``http.cookiejar.request_host(self)`` 。这是用户发起初始请求的主机名或 IP 地址。假设请求是针对 "
402+
"HTML 文档中的图片数据发起的,则本属性应为对包含图像的页面发起请求的主机。"
393403

394404
#: ../../library/urllib.request.rst:234
395405
msgid ""
@@ -399,6 +409,9 @@ msgid ""
399409
"if the request is for an image in an HTML document, and the user had no "
400410
"option to approve the automatic fetching of the image, this should be true."
401411
msgstr ""
412+
"*unverifiable* 应该标示出请求是否无法验证,定义参见 :rfc:`2965` 。默认值为 ``False`` "
413+
"。所谓无法验证的请求,是指用户没有机会对请求的 URL 做验证。例如,如果请求是针对 HTML "
414+
"文档中的图像,用户没有机会去许可能自动读取图像,则本属性应为 True。 "
402415

403416
#: ../../library/urllib.request.rst:241
404417
msgid ""
@@ -409,6 +422,10 @@ msgid ""
409422
"Subclasses may indicate a different default method by setting the "
410423
":attr:`~Request.method` attribute in the class itself."
411424
msgstr ""
425+
"*method* 应为字符串,标示要采用的 HTTP 请求方法(例如 ``'HEAD'`` )。如果给出本参数,其值会存储在 "
426+
":attr:`~Request.method` 属性中,并由 :meth:`get_method()` 使用。如果 *data* 为``None`` "
427+
"则默认值为 ``'GET'`` ,否则为 ``'POST'``。子类可以设置 :attr:`~Request.method` "
428+
"属性来标示不同的默认请求方法。"
412429

413430
#: ../../library/urllib.request.rst:249
414431
msgid ""
@@ -419,21 +436,26 @@ msgid ""
419436
"the headers. There is no support for a 100-continue expectation in the "
420437
"library."
421438
msgstr ""
439+
"如果 data 对象无法分多次传递其内容(比如文件或只能生成一次内容的可迭代对象)并且由于 HTTP "
440+
"重定向或身份验证而发生请求重试行为,则该请求不会正常工作。 *data* 是紧挨着头部信息发送给 HTTP 服务器的。现有库不支持 HTTP "
441+
"100-continue 的征询。"
422442

423443
#: ../../library/urllib.request.rst:256
424444
msgid ":attr:`Request.method` argument is added to the Request class."
425445
msgstr "Request 类增加了 :attr:`Request.method` 参数。"
426446

427447
#: ../../library/urllib.request.rst:259
428448
msgid "Default :attr:`Request.method` may be indicated at the class level."
429-
msgstr ""
449+
msgstr "默认 :attr:`Request.method` 可以在类中标明。 "
430450

431451
#: ../../library/urllib.request.rst:262
432452
msgid ""
433453
"Do not raise an error if the ``Content-Length`` has not been provided and "
434454
"*data* is neither ``None`` nor a bytes object. Fall back to use chunked "
435455
"transfer encoding instead."
436456
msgstr ""
457+
"如果给出了 ``Content-Length`` ,且 *data* 既不为 ``None`` "
458+
"也不是字节串对象,则不会触发错误。而会退而求其次采用分块传输的编码格式。"
437459

438460
#: ../../library/urllib.request.rst:269
439461
msgid ""

library/xml.dom.po

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# dannyvi <[email protected]>, 2019
99
# Meng Du <[email protected]>, 2019
1010
# ppcfish <[email protected]>, 2019
11-
# Jiuh-star <[email protected]>, 2021
1211
# Freesand Leo <[email protected]>, 2021
12+
# Jiuh-star <[email protected]>, 2021
1313
#
1414
#, fuzzy
1515
msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818
"Report-Msgid-Bugs-To: \n"
1919
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
2020
"PO-Revision-Date: 2019-09-01 03:21+0000\n"
21-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2021\n"
21+
"Last-Translator: Jiuh-star <jiuh.star@gmail.com>, 2021\n"
2222
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2323
"MIME-Version: 1.0\n"
2424
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1177,7 +1177,7 @@ msgstr "当尝试插入一个 :class:`Attr` 节点但该节点已存在于文档
11771177
msgid ""
11781178
"Raised if a parameter or an operation is not supported on the underlying "
11791179
"object."
1180-
msgstr ""
1180+
msgstr "当某个参数或操作在底层对象中不受支持时被引发。"
11811181

11821182
#: ../../library/xml.dom.rst:861
11831183
msgid ""
@@ -1186,16 +1186,18 @@ msgid ""
11861186
"recommendation. For example, attempting to create an :class:`Element` node "
11871187
"with a space in the element type name will cause this error to be raised."
11881188
msgstr ""
1189+
"当某个字符串参数包含的字符在使用它的上下文中不被 XML 1.0 标准建议所允许时引发。 例如,尝试创建一个元素类型名称中带有空格的 "
1190+
":class:`Element` 节点将导致此错误被引发。"
11891191

11901192
#: ../../library/xml.dom.rst:869
11911193
msgid "Raised when an attempt is made to modify the type of a node."
1192-
msgstr ""
1194+
msgstr "当尝试修改某个节点的类型时被引发。"
11931195

11941196
#: ../../library/xml.dom.rst:874
11951197
msgid ""
11961198
"Raised when an attempt is made to use an object that is not defined or is no"
11971199
" longer usable."
1198-
msgstr ""
1200+
msgstr "当尝试使用未定义或不再可用的的对象时被引发。"
11991201

12001202
#: ../../library/xml.dom.rst:880
12011203
msgid ""
@@ -1210,40 +1212,42 @@ msgid ""
12101212
"example, :meth:`NamedNodeMap.removeNamedItem` will raise this if the node "
12111213
"passed in does not exist in the map."
12121214
msgstr ""
1215+
"当某个节点不存在于被引用的上下文中时引发的异常。 例如,:meth:`NamedNodeMap.removeNamedItem` "
1216+
"将在所传入的节点不在于于映射中时引发此异常。"
12131217

12141218
#: ../../library/xml.dom.rst:894
12151219
msgid ""
12161220
"Raised when the implementation does not support the requested type of object"
12171221
" or operation."
1218-
msgstr ""
1222+
msgstr "当具体实现不支持所请求的对象类型或操作时被引发。"
12191223

12201224
#: ../../library/xml.dom.rst:900
12211225
msgid ""
12221226
"This is raised if data is specified for a node which does not support data."
1223-
msgstr ""
1227+
msgstr "当为某个不支持数据 的节点指定数据时被引发。"
12241228

12251229
#: ../../library/xml.dom.rst:907
12261230
msgid ""
12271231
"Raised on attempts to modify an object where modifications are not allowed "
12281232
"(such as for read-only nodes)."
1229-
msgstr ""
1233+
msgstr "当尝试修改某个不允许修改的对象(例如只读节点)时被引发。"
12301234

12311235
#: ../../library/xml.dom.rst:913
12321236
msgid "Raised when an invalid or illegal string is specified."
1233-
msgstr ""
1237+
msgstr "当指定了无效或非法的字符串时被引发。"
12341238

12351239
#: ../../library/xml.dom.rst:920
12361240
msgid ""
12371241
"Raised when a node is inserted in a different document than it currently "
12381242
"belongs to, and the implementation does not support migrating the node from "
12391243
"one document to the other."
1240-
msgstr ""
1244+
msgstr "当将某个节点插入非其当前所属的另一个文档,并且具体实现不支持从一个文档向一个文档迁移节点时被引发。"
12411245

12421246
#: ../../library/xml.dom.rst:924
12431247
msgid ""
12441248
"The exception codes defined in the DOM recommendation map to the exceptions "
12451249
"described above according to this table:"
1246-
msgstr ""
1250+
msgstr "DOM 建议映射中针对上述异常而定义的异常代码如下表所示:"
12471251

12481252
#: ../../library/xml.dom.rst:928
12491253
msgid "Constant"

0 commit comments

Comments
 (0)