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

Skip to content

Commit cdc4eaf

Browse files
committed
[po] auto sync bot
1 parent fee4fab commit cdc4eaf

2 files changed

Lines changed: 81 additions & 52 deletions

File tree

library/2to3.po

Lines changed: 78 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ msgid ""
3232
":mod:`lib2to3` could also be adapted to custom applications in which Python "
3333
"code needs to be edited automatically."
3434
msgstr ""
35-
"2to3 是一个 Python 程序,它可以用来读取 Python 2.x 版本的代码,并使用一系列的 *fixer* 来将其转换为合法的 Python"
36-
" 3.x 代码。标准库中已经包含了丰富的 fixer,这足以处理绝大多数代码。不过 2to3 的支持库 :mod:`lib2to3` "
37-
"是一个很灵活通用的库,所以你也可以为 2to3 编写你自己的 fixer。:mod:`lib2to3` 也可以用在那些需要自动处理 Python "
35+
"2to3 是一个 Python 程序,它可以用来读取 Python 2.x 版本的代码,并使用一系列的*修复器 (fixer)* 来将其转换为合法的 "
36+
"Python 3.x 代码。标准库中已经包含了丰富的修复器,这足以处理绝大多数代码。不过 2to3 的支持库 :mod:`lib2to3` "
37+
"是一个很灵活通用的库,所以你也可以为 2to3 编写你自己的修复器。:mod:`lib2to3` 也可以用在那些需要自动处理 Python "
3838
"代码的应用中。"
3939

4040
#: ../../library/2to3.rst:20
@@ -90,27 +90,26 @@ msgid ""
9090
" disables a fixer. The following example runs only the ``imports`` and "
9191
"``has_key`` fixers:"
9292
msgstr ""
93-
"默认情况下,2to3 会执行 :ref:`预定义 fixers <2to3-fixers>` 的集合。使用 :option:`!-l` "
94-
"参数可以列出所有可用的 fixers。使用 :option:`!-f` 参数可以明确指定需要使用的 fixers 集合。而使用 "
95-
":option:`!-x` 参数则可以明确指定不使用的 fixer。下面的例子会只使用 ``imports`` 和 ``has_key`` fixer "
96-
"运行:"
93+
"默认情况下,2to3 会执行 :ref:`预定义修复器 <2to3-fixers>` 的集合。使用 :option:`!-l` "
94+
"参数可以列出所有可用的修复器。使用 :option:`!-f` 参数可以明确指定需要使用的修复器集合。而使用 :option:`!-x` "
95+
"参数则可以明确指定不使用的修复器。下面的例子会只使用 ``imports`` 和 ``has_key`` 修复器运行:"
9796

9897
#: ../../library/2to3.rst:70
9998
msgid "This command runs every fixer except the ``apply`` fixer:"
100-
msgstr "这个命令会执行除了 ``apply`` 之外的所有 fixer:"
99+
msgstr "这个命令会执行除了 ``apply`` 之外的所有修复器:"
101100

102101
#: ../../library/2to3.rst:76
103102
msgid ""
104103
"Some fixers are *explicit*, meaning they aren't run by default and must be "
105104
"listed on the command line to be run. Here, in addition to the default "
106105
"fixers, the ``idioms`` fixer is run:"
107106
msgstr ""
108-
"有一些 fixer 是需要*明确指定*的,它们默认不会执行,必须在命令行中列出才会执行。比如下面的例子,除了默认的 fixer 以外,还会执行 "
109-
"``idioms`` fixer:"
107+
"有一些修复器是需要*显式指定*的,它们默认不会执行,必须在命令行中列出才会执行。比如下面的例子,除了默认的修复器以外,还会执行 ``idioms`` "
108+
"修复器:"
110109

111110
#: ../../library/2to3.rst:84
112111
msgid "Notice how passing ``all`` enables all default fixers."
113-
msgstr "注意这里使用 ``all`` 来启用所有默认的 fixer。"
112+
msgstr "注意这里使用 ``all`` 来启用所有默认的修复器。"
114113

115114
#: ../../library/2to3.rst:86
116115
msgid ""
@@ -151,7 +150,7 @@ msgstr ""
151150
"由于一些 print 语句既可能是函数调用,也可能是代码语句,2to3 并不总是能读取含有 print 函数的文件。当 2to3 检测到代码中存在 "
152151
"``from __future__ import print_function`` 编译指令时,会在内部语法中将 :func:`print` "
153152
"作为函数来处理。这一变动也可以使用 :option:`!-p` 选项手动开启。使用 :option:`-p` 来为已经将 print "
154-
"语句转为函数调用的代码执行 fixer。"
153+
"语句转为函数调用的代码运行 fixer。"
155154

156155
#: ../../library/2to3.rst:107
157156
msgid ""
@@ -160,10 +159,13 @@ msgid ""
160159
":option:`!-n` flag is required when using this as backup files do not make "
161160
"sense when not overwriting the input files."
162161
msgstr ""
162+
":option:`!-o` 或 :option:`!--output-dir` "
163+
"选项可以指定将转换后的文件写入其他目录中。由于这种情况下不会覆写原始文件,所以创建副本文件毫无意义,因此也需要使用 :option:`!-n` "
164+
"选项来禁用创建副本。"
163165

164166
#: ../../library/2to3.rst:112
165167
msgid "The :option:`!-o` option was added."
166-
msgstr ""
168+
msgstr "增加了 :option:`!-o` 选项。"
167169

168170
#: ../../library/2to3.rst:115
169171
msgid ""
@@ -173,147 +175,160 @@ msgid ""
173175
"is copied with translation from one directory to another. This option "
174176
"implies the :option:`!-w` flag as it would not make sense otherwise."
175177
msgstr ""
178+
":option:`!-W` 或 :option:`!--write-unchanged-files` 选项用来告诉 2to3 "
179+
"始终需要输出文件,即使没有任何改动。这在使用 :option:`!-o` 参数时十分有用,这样就可以将整个 Python "
180+
"源码包完整地转换到另一个目录。这个选项隐含了 :option:`!-w` 选项,否则等于没有作用。"
176181

177182
#: ../../library/2to3.rst:121
178183
msgid "The :option:`!-W` flag was added."
179-
msgstr ""
184+
msgstr "增加了 :option:`!-W` 选项。"
180185

181186
#: ../../library/2to3.rst:124
182187
msgid ""
183188
"The :option:`!--add-suffix` option specifies a string to append to all "
184189
"output filenames. The :option:`!-n` flag is required when specifying this "
185190
"as backups are not necessary when writing to different filenames. Example:"
186191
msgstr ""
192+
":option:`!--add-suffix` "
193+
"选项接受一个字符串,用来作为后缀附加在输出文件名后面的后面。由于写入的文件名与原始文件不同,所以没有必要创建副本,因此 :option:`!-n` "
194+
"选项也是必要的。举个例子:"
187195

188196
#: ../../library/2to3.rst:132
189197
msgid "Will cause a converted file named ``example.py3`` to be written."
190-
msgstr ""
198+
msgstr "这样会把转换后的文件写入 ``example.py3`` 文件。"
191199

192200
#: ../../library/2to3.rst:134
193201
msgid "The :option:`!--add-suffix` option was added."
194-
msgstr ""
202+
msgstr "增加了 :option:`!--add-suffix` 选项。"
195203

196204
#: ../../library/2to3.rst:137
197205
msgid "To translate an entire project from one directory tree to another use:"
198-
msgstr ""
206+
msgstr "将整个项目从一个目录转换到另一个目录可以用这样的命令:"
199207

200208
#: ../../library/2to3.rst:147
201209
msgid "Fixers"
202-
msgstr ""
210+
msgstr "修复器"
203211

204212
#: ../../library/2to3.rst:149
205213
msgid ""
206214
"Each step of transforming code is encapsulated in a fixer. The command "
207215
"``2to3 -l`` lists them. As :ref:`documented above <2to3-using>`, each can "
208216
"be turned on and off individually. They are described here in more detail."
209217
msgstr ""
218+
"转换代码的每一个步骤都封装在修复器中。可以使用 ``2to3 -l`` 来列出可用的修复器。:ref:`之前已经提到 "
219+
"<2to3-using>`,每个修复器都可以独立地打开或是关闭。下面会对各个修复器做更详细的描述。"
210220

211221
#: ../../library/2to3.rst:156
212222
msgid ""
213223
"Removes usage of :func:`apply`. For example ``apply(function, *args, "
214224
"**kwargs)`` is converted to ``function(*args, **kwargs)``."
215225
msgstr ""
226+
"移除对 :func:`apply` 的使用,举例来说,``apply(function, *args, **kwargs)`` 会被转换成 "
227+
"``function(*args, **kwargs)``。"
216228

217229
#: ../../library/2to3.rst:161
218230
msgid ""
219231
"Replaces deprecated :mod:`unittest` method names with the correct ones."
220-
msgstr ""
232+
msgstr "将已弃用的 :mod:`unittest` 方法替换为正确的。"
221233

222234
#: ../../library/2to3.rst:164 ../../library/2to3.rst:352
223235
msgid "From"
224-
msgstr ""
236+
msgstr "Python 2.x"
225237

226238
#: ../../library/2to3.rst:164 ../../library/2to3.rst:352
227239
msgid "To"
228-
msgstr ""
240+
msgstr "Python 3.x"
229241

230242
#: ../../library/2to3.rst:166
231243
msgid "``failUnlessEqual(a, b)``"
232-
msgstr ""
244+
msgstr "``failUnlessEqual(a, b)``"
233245

234246
#: ../../library/2to3.rst:166 ../../library/2to3.rst:168
235247
msgid ":meth:`assertEqual(a, b) <unittest.TestCase.assertEqual>`"
236-
msgstr ""
248+
msgstr ":meth:`assertEqual(a, b) <unittest.TestCase.assertEqual>`"
237249

238250
#: ../../library/2to3.rst:168
239251
msgid "``assertEquals(a, b)``"
240-
msgstr ""
252+
msgstr "``assertEquals(a, b)``"
241253

242254
#: ../../library/2to3.rst:170
243255
msgid "``failIfEqual(a, b)``"
244-
msgstr ""
256+
msgstr "``failIfEqual(a, b)``"
245257

246258
#: ../../library/2to3.rst:170 ../../library/2to3.rst:172
247259
msgid ":meth:`assertNotEqual(a, b) <unittest.TestCase.assertNotEqual>`"
248-
msgstr ""
260+
msgstr ":meth:`assertNotEqual(a, b) <unittest.TestCase.assertNotEqual>`"
249261

250262
#: ../../library/2to3.rst:172
251263
msgid "``assertNotEquals(a, b)``"
252-
msgstr ""
264+
msgstr "``assertNotEquals(a, b)``"
253265

254266
#: ../../library/2to3.rst:174
255267
msgid "``failUnless(a)``"
256-
msgstr ""
268+
msgstr "``failUnless(a)``"
257269

258270
#: ../../library/2to3.rst:174 ../../library/2to3.rst:176
259271
msgid ":meth:`assertTrue(a) <unittest.TestCase.assertTrue>`"
260-
msgstr ""
272+
msgstr ":meth:`assertTrue(a) <unittest.TestCase.assertTrue>`"
261273

262274
#: ../../library/2to3.rst:176
263275
msgid "``assert_(a)``"
264-
msgstr ""
276+
msgstr "``assert_(a)``"
265277

266278
#: ../../library/2to3.rst:178
267279
msgid "``failIf(a)``"
268-
msgstr ""
280+
msgstr "``failIf(a)``"
269281

270282
#: ../../library/2to3.rst:178
271283
msgid ":meth:`assertFalse(a) <unittest.TestCase.assertFalse>`"
272-
msgstr ""
284+
msgstr ":meth:`assertFalse(a) <unittest.TestCase.assertFalse>`"
273285

274286
#: ../../library/2to3.rst:180
275287
msgid "``failUnlessRaises(exc, cal)``"
276-
msgstr ""
288+
msgstr "``failUnlessRaises(exc, cal)``"
277289

278290
#: ../../library/2to3.rst:180
279291
msgid ":meth:`assertRaises(exc, cal) <unittest.TestCase.assertRaises>`"
280-
msgstr ""
292+
msgstr ":meth:`assertRaises(exc, cal) <unittest.TestCase.assertRaises>`"
281293

282294
#: ../../library/2to3.rst:182
283295
msgid "``failUnlessAlmostEqual(a, b)``"
284-
msgstr ""
296+
msgstr "``failUnlessAlmostEqual(a, b)``"
285297

286298
#: ../../library/2to3.rst:182 ../../library/2to3.rst:184
287299
msgid ":meth:`assertAlmostEqual(a, b) <unittest.TestCase.assertAlmostEqual>`"
288-
msgstr ""
300+
msgstr ":meth:`assertAlmostEqual(a, b) <unittest.TestCase.assertAlmostEqual>`"
289301

290302
#: ../../library/2to3.rst:184
291303
msgid "``assertAlmostEquals(a, b)``"
292-
msgstr ""
304+
msgstr "``assertAlmostEquals(a, b)``"
293305

294306
#: ../../library/2to3.rst:186
295307
msgid "``failIfAlmostEqual(a, b)``"
296-
msgstr ""
308+
msgstr "``failIfAlmostEqual(a, b)``"
297309

298310
#: ../../library/2to3.rst:186 ../../library/2to3.rst:188
299311
msgid ""
300312
":meth:`assertNotAlmostEqual(a, b) <unittest.TestCase.assertNotAlmostEqual>`"
301313
msgstr ""
314+
":meth:`assertNotAlmostEqual(a, b) <unittest.TestCase.assertNotAlmostEqual>`"
302315

303316
#: ../../library/2to3.rst:188
304317
msgid "``assertNotAlmostEquals(a, b)``"
305-
msgstr ""
318+
msgstr "``assertNotAlmostEquals(a, b)``"
306319

307320
#: ../../library/2to3.rst:194
308321
msgid "Converts :class:`basestring` to :class:`str`."
309-
msgstr ""
322+
msgstr "将 :class:`basestring` 转换为 :class:`str`。"
310323

311324
#: ../../library/2to3.rst:198
312325
msgid ""
313326
"Converts :class:`buffer` to :class:`memoryview`. This fixer is optional "
314327
"because the :class:`memoryview` API is similar but not exactly the same as "
315328
"that of :class:`buffer`."
316329
msgstr ""
330+
"将 :class:`buffer` 转换为 :class:`memoryview`。这个修复器是可选的,因为 :class:`memoryview` "
331+
"API 和 :class:`buffer` 很相似,但不完全一样。"
317332

318333
#: ../../library/2to3.rst:204
319334
msgid ""
@@ -325,48 +340,59 @@ msgid ""
325340
":meth:`dict.values`. It also wraps existing usages of :meth:`dict.items`, "
326341
":meth:`dict.keys`, and :meth:`dict.values` in a call to :class:`list`."
327342
msgstr ""
343+
"修复字典迭代方法。:meth:`dict.iteritems` 会转换成 "
344+
":meth:`dict.items`,:meth:`dict.iterkeys` 会转换成 "
345+
":meth:`dict.keys`,:meth:`dict.itervalues` 会转换成 "
346+
":meth:`dict.values`。类似的,:meth:`dict.viewitems`,:meth:`dict.viewkeys` 和 "
347+
":meth:`dict.viewvalues` 会分别转换成 :meth:`dict.items`,:meth:`dict.keys` 和 "
348+
":meth:`dict.values`。另外也会将原有的 :meth:`dict.items`,:meth:`dict.keys` 和 "
349+
":meth:`dict.values` 方法调用用 :class:`list` 包装一层。"
328350

329351
#: ../../library/2to3.rst:214
330352
msgid "Converts ``except X, T`` to ``except X as T``."
331-
msgstr ""
353+
msgstr "将 ``except X, T`` 转换为 ``except X as T``。"
332354

333355
#: ../../library/2to3.rst:218
334356
msgid "Converts the ``exec`` statement to the :func:`exec` function."
335-
msgstr ""
357+
msgstr "将 ``exec`` 语句转换为 :func:`exec` 函数调用。"
336358

337359
#: ../../library/2to3.rst:222
338360
msgid ""
339361
"Removes usage of :func:`execfile`. The argument to :func:`execfile` is "
340362
"wrapped in calls to :func:`open`, :func:`compile`, and :func:`exec`."
341363
msgstr ""
364+
"移除 :func:`execfile` 的使用。:func:`execfile` 的实参会使用 :func:`open`,:func:`compile`"
365+
" 和 :func:`exec` 包装。"
342366

343367
#: ../../library/2to3.rst:227
344368
msgid ""
345369
"Changes assignment of :attr:`sys.exitfunc` to use of the :mod:`atexit` "
346370
"module."
347-
msgstr ""
371+
msgstr "将对 :attr:`sys.exitfunc` 的赋值改为使用 :mod:`atexit` 模块代替。"
348372

349373
#: ../../library/2to3.rst:232
350374
msgid "Wraps :func:`filter` usage in a :class:`list` call."
351-
msgstr ""
375+
msgstr "将 :func:`filter` 函数用 :class:`list` 包装一层。"
352376

353377
#: ../../library/2to3.rst:236
354378
msgid ""
355379
"Fixes function attributes that have been renamed. For example, "
356380
"``my_function.func_closure`` is converted to ``my_function.__closure__``."
357381
msgstr ""
382+
"修复已经重命名的函数属性。比如 ``my_function.func_closure`` 会被转换为 "
383+
"``my_function.__closure__``。"
358384

359385
#: ../../library/2to3.rst:241
360386
msgid "Removes ``from __future__ import new_feature`` statements."
361-
msgstr ""
387+
msgstr "移除 ``from __future__ import new_feature`` 语句。"
362388

363389
#: ../../library/2to3.rst:245
364390
msgid "Renames :func:`os.getcwdu` to :func:`os.getcwd`."
365-
msgstr ""
391+
msgstr "将 :func:`os.getcwdu` 重命名为 :func:`os.getcwd`。"
366392

367393
#: ../../library/2to3.rst:249
368394
msgid "Changes ``dict.has_key(key)`` to ``key in dict``."
369-
msgstr ""
395+
msgstr "将 ``dict.has_key(key)`` 转换为 ``key in dict``。"
370396

371397
#: ../../library/2to3.rst:253
372398
msgid ""
@@ -376,14 +402,17 @@ msgid ""
376402
"``while 1`` becomes ``while True``. This fixer also tries to make use of "
377403
":func:`sorted` in appropriate places. For example, this block ::"
378404
msgstr ""
405+
"这是一个可选的修复器,会进行多种转换,将 Python 代码变成更加常见的写法。类似 ``type(x) is SomeClass`` 和 "
406+
"``type(x) == SomeClass`` 的类型对比会被转换成 ``isinstance(x, SomeClass)``。``while 1``"
407+
" 转换成 ``while True``。这个修复器还会在合适的地方使用 :func:`sorted` 函数。举个例子,这样的代码:"
379408

380409
#: ../../library/2to3.rst:262
381410
msgid "is changed to ::"
382-
msgstr ""
411+
msgstr "会被转换为:"
383412

384413
#: ../../library/2to3.rst:268
385414
msgid "Detects sibling imports and converts them to relative imports."
386-
msgstr ""
415+
msgstr "检测 sibling imports,并将其转换成相对 import。"
387416

388417
#: ../../library/2to3.rst:272
389418
msgid "Handles module renames in the standard library."

library/time.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ msgstr ""
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2018-06-30 05:56+0900\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: Jerry Chen <jerrychen9657@gmail.com>, 2017\n"
13+
"Last-Translator: cissoid <yangtukun1412@gmail.com>, 2018\n"
1414
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
@@ -138,11 +138,11 @@ msgstr ""
138138

139139
#: ../../library/time.rst:105
140140
msgid "From"
141-
msgstr ""
141+
msgstr "Python 2.x"
142142

143143
#: ../../library/time.rst:105
144144
msgid "To"
145-
msgstr ""
145+
msgstr "Python 3.x"
146146

147147
#: ../../library/time.rst:105
148148
msgid "Use"

0 commit comments

Comments
 (0)