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

Skip to content

Commit 13093d3

Browse files
[po] auto sync
1 parent 401ceee commit 13093d3

File tree

13 files changed

+452
-19
lines changed

13 files changed

+452
-19
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "93.05%", "updated_at": "2024-10-11T15:47:04Z"}
1+
{"translation": "93.25%", "updated_at": "2024-10-11T17:47:04Z"}

c-api/init.po

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,8 @@ msgid ""
17951795
"held. The thread state must have been reset with a previous call to "
17961796
":c:func:`PyThreadState_Clear`."
17971797
msgstr ""
1798+
"销毁当前线程状态并释放全局解释器锁。 与 :c:func:`PyThreadState_Delete` 类似,必须持有全局解释器锁。 "
1799+
"线程状态必须已通过之前对 :c:func:`PyThreadState_Clear` 的调用来重置。"
17981800

17991801
#: ../../c-api/init.rst:1279
18001802
msgid "Get the current frame of the Python thread state *tstate*."

c-api/unicode.po

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-10-04 14:53+0000\n"
14+
"POT-Creation-Date: 2024-10-11 14:48+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -871,7 +871,7 @@ msgstr "返回 Unicode 对象码位的长度。"
871871

872872
#: ../../c-api/unicode.rst:603
873873
msgid "On error, set an exception and return ``-1``."
874-
msgstr ""
874+
msgstr "发生错误时,将设置异常并返回 ``-1``。"
875875

876876
#: ../../c-api/unicode.rst:614
877877
msgid ""
@@ -919,7 +919,7 @@ msgstr "该函数将检查 *unicode* 是否为 Unicode 对象,索引是否未
919919

920920
#: ../../c-api/unicode.rst:648
921921
msgid "Return ``0`` on success, ``-1`` on error with an exception set."
922-
msgstr ""
922+
msgstr "成功时返回 ``0``,出错时返回 ``-1`` 并设置一个异常。"
923923

924924
#: ../../c-api/unicode.rst:655
925925
msgid ""
@@ -932,14 +932,16 @@ msgstr ""
932932

933933
#: ../../c-api/unicode.rst:659
934934
msgid "Return character on success, ``-1`` on error with an exception set."
935-
msgstr ""
935+
msgstr "成功时返回字符,出错时返回 ``-1`` 并设置一个异常。"
936936

937937
#: ../../c-api/unicode.rst:667
938938
msgid ""
939939
"Return a substring of *unicode*, from character index *start* (included) to "
940940
"character index *end* (excluded). Negative indices are not supported. On "
941941
"error, set an exception and return ``NULL``."
942942
msgstr ""
943+
"返回 *unicode* 的一个子串,从字符索引 *start* (含) 到字符索引 *end* (不含)。 不支持负索引号。 "
944+
"出错时,将设置一个异常并返回 ``NULL``。"
943945

944946
#: ../../c-api/unicode.rst:677
945947
msgid ""

faq/design.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-10-04 14:53+0000\n"
14+
"POT-Creation-Date: 2024-10-11 14:48+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -595,8 +595,8 @@ msgid ""
595595
"(which is exactly the same type of object that a lambda expression yields) "
596596
"is assigned!"
597597
msgstr ""
598-
"函数已经是 Python 中的第一等对象,最可在局部作用域中声明。 因此使用 lambda 而非局部定义函数的唯一优点是你不需要为函数指定名称 -- "
599-
"但那只是一个被赋值为函数对象(它的类型与 lambda 表达式所产生的对象完全相同)的局部变量!"
598+
"函数已经是 Python 中的第一等对象,并且可以在局部作用域中声明。 因此使用 lambda 而非局部定义函数的唯一优点是你不需要为函数指定名称 --"
599+
" 但那只是一个被赋值为函数对象(它的类型与 lambda 表达式所产生的对象完全相同)的局部变量!"
600600

601601
#: ../../faq/design.rst:328
602602
msgid "Can Python be compiled to machine code, C or some other language?"

glossary.po

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ msgstr ""
23992399

24002400
#: ../../glossary.rst:1141
24012401
msgid "soft deprecated"
2402-
msgstr ""
2402+
msgstr "软弃用"
24032403

24042404
#: ../../glossary.rst:1143
24052405
msgid ""
@@ -2419,6 +2419,8 @@ msgid ""
24192419
"See `PEP 387: Soft Deprecation <https://peps.python.org/pep-0387/#soft-"
24202420
"deprecation>`_."
24212421
msgstr ""
2422+
"参见 `PEP 387: Soft Deprecation <https://peps.python.org/pep-0387/#soft-"
2423+
"deprecation>`_。"
24222424

24232425
#: ../../glossary.rst:1152
24242426
msgid "special method"

howto/sorting.po

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
14+
"POT-Creation-Date: 2024-10-11 14:48+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -154,7 +154,7 @@ msgstr ""
154154
"... ('jane', 'B', 12),\n"
155155
"... ('dave', 'B', 10),\n"
156156
"... ]\n"
157-
">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n"
157+
">>> sorted(student_tuples, key=lambda student: student[2]) # 按年龄排序\n"
158158
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
159159

160160
#: ../../howto/sorting.rst:79
@@ -286,6 +286,16 @@ msgid ""
286286
">>> sorted(names, key=partial(normalize, 'NFC'))\n"
287287
"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']"
288288
msgstr ""
289+
">>> from functools import partial\n"
290+
">>> from unicodedata import normalize\n"
291+
"\n"
292+
">>> names = 'Zoë Åbjørn Núñez Élana Zeke Abe Nubia Eloise'.split()\n"
293+
"\n"
294+
">>> sorted(names, key=partial(normalize, 'NFD'))\n"
295+
"['Abe', 'Åbjørn', 'Eloise', 'Élana', 'Nubia', 'Núñez', 'Zeke', 'Zoë']\n"
296+
"\n"
297+
">>> sorted(names, key=partial(normalize, 'NFC'))\n"
298+
"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']"
289299

290300
#: ../../howto/sorting.rst:153
291301
msgid "Ascending and Descending"
@@ -308,6 +318,11 @@ msgid ""
308318
">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n"
309319
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]"
310320
msgstr ""
321+
">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n"
322+
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n"
323+
"\n"
324+
">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n"
325+
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]"
311326

312327
#: ../../howto/sorting.rst:168
313328
msgid "Sort Stability and Complex Sorts"
@@ -329,6 +344,9 @@ msgid ""
329344
">>> sorted(data, key=itemgetter(0))\n"
330345
"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]"
331346
msgstr ""
347+
">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n"
348+
">>> sorted(data, key=itemgetter(0))\n"
349+
"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]"
332350

333351
#: ../../howto/sorting.rst:180
334352
msgid ""
@@ -351,6 +369,9 @@ msgid ""
351369
">>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on primary key, descending\n"
352370
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
353371
msgstr ""
372+
">>> s = sorted(student_objects, key=attrgetter('age')) # 现在根据主要键(成绩)降序排序\n"
373+
">>> sorted(s, key=attrgetter('grade'), reverse=True) # 根据次要键(年龄)排序\n"
374+
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)"
354375

355376
#: ../../howto/sorting.rst:193
356377
msgid ""
@@ -368,6 +389,13 @@ msgid ""
368389
">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n"
369390
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
370391
msgstr ""
392+
">>> def multisort(xs, specs):\n"
393+
"... for key, reverse in reversed(specs):\n"
394+
"... xs.sort(key=attrgetter(key), reverse=reverse)\n"
395+
"... return xs\n"
396+
"\n"
397+
">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n"
398+
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
371399

372400
#: ../../howto/sorting.rst:206
373401
msgid ""
@@ -414,6 +442,10 @@ msgid ""
414442
">>> [student for grade, i, student in decorated] # undecorate\n"
415443
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]"
416444
msgstr ""
445+
">>> decorated = [(student.grade, i, student) for i, student in enumerate(student_objects)]\n"
446+
">>> decorated.sort()\n"
447+
">>> [student for grade, i, student in decorated] # 取消装饰\n"
448+
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]"
417449

418450
#: ../../howto/sorting.rst:231
419451
msgid ""
@@ -501,7 +533,7 @@ msgstr ""
501533

502534
#: ../../howto/sorting.rst:273
503535
msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order"
504-
msgstr ""
536+
msgstr "sorted(words, key=cmp_to_key(strcoll)) # 基于地区的排序规则"
505537

506538
#: ../../howto/sorting.rst:276
507539
msgid "Odds and Ends"
@@ -536,6 +568,12 @@ msgid ""
536568
">>> standard_way\n"
537569
"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]"
538570
msgstr ""
571+
">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n"
572+
">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n"
573+
">>> double_reversed = list(reversed(sorted(reversed(data), key=itemgetter(0))))\n"
574+
">>> assert standard_way == double_reversed\n"
575+
">>> standard_way\n"
576+
"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]"
539577

540578
#: ../../howto/sorting.rst:297
541579
msgid ""
@@ -552,6 +590,9 @@ msgid ""
552590
">>> sorted(student_objects)\n"
553591
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
554592
msgstr ""
593+
">>> Student.__lt__ = lambda self, other: self.age < other.age\n"
594+
">>> sorted(student_objects)\n"
595+
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
555596

556597
#: ../../howto/sorting.rst:307
557598
msgid ""
@@ -581,6 +622,10 @@ msgid ""
581622
">>> sorted(students, key=newgrades.__getitem__)\n"
582623
"['jane', 'dave', 'john']"
583624
msgstr ""
625+
">>> students = ['dave', 'john', 'jane']\n"
626+
">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n"
627+
">>> sorted(students, key=newgrades.__getitem__)\n"
628+
"['jane', 'dave', 'john']"
584629

585630
#: ../../howto/sorting.rst:327
586631
msgid "Partial Sorts"

howto/unicode.po

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-10-04 14:53+0000\n"
14+
"POT-Creation-Date: 2024-10-11 14:48+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -1150,6 +1150,10 @@ msgid ""
11501150
" f.seek(0)\n"
11511151
" print(repr(f.readline()[:1]))"
11521152
msgstr ""
1153+
"with open('test', encoding='utf-8', mode='w+') as f:\n"
1154+
" f.write('\\u4500 blah blah blah\\n')\n"
1155+
" f.seek(0)\n"
1156+
" print(repr(f.readline()[:1]))"
11531157

11541158
#: ../../howto/unicode.rst:588
11551159
msgid ""
@@ -1219,6 +1223,9 @@ msgid ""
12191223
"with open(filename, 'w') as f:\n"
12201224
" f.write('blah\\n')"
12211225
msgstr ""
1226+
"filename = 'filename\\u4500abc'\n"
1227+
"with open(filename, 'w') as f:\n"
1228+
" f.write('blah\\n')"
12221229

12231230
#: ../../howto/unicode.rst:626
12241231
msgid ""
@@ -1254,6 +1261,13 @@ msgid ""
12541261
"print(os.listdir(b'.'))\n"
12551262
"print(os.listdir('.'))"
12561263
msgstr ""
1264+
"fn = 'filename\\u4500abc'\n"
1265+
"f = open(fn, 'w')\n"
1266+
"f.close()\n"
1267+
"\n"
1268+
"import os\n"
1269+
"print(os.listdir(b'.'))\n"
1270+
"print(os.listdir('.'))"
12571271

12581272
#: ../../howto/unicode.rst:647
12591273
msgid "will produce the following output:"
@@ -1265,6 +1279,9 @@ msgid ""
12651279
"[b'filename\\xe4\\x94\\x80abc', ...]\n"
12661280
"['filename\\u4500abc', ...]"
12671281
msgstr ""
1282+
"$ python listdir-test.py\n"
1283+
"[b'filename\\xe4\\x94\\x80abc', ...]\n"
1284+
"['filename\\u4500abc', ...]"
12681285

12691286
#: ../../howto/unicode.rst:655
12701287
msgid ""
@@ -1359,6 +1376,13 @@ msgid ""
13591376
" # reader/writer: used to read and write to the stream.\n"
13601377
" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )"
13611378
msgstr ""
1379+
"new_f = codecs.StreamRecoder(f,\n"
1380+
" # en/decoder: 被 read() 用来编码其结果\n"
1381+
" # 并被 write() 用来解码其输入。\n"
1382+
" codecs.getencoder('utf-8'), codecs.getdecoder('utf-8'),\n"
1383+
"\n"
1384+
" # reader/writer: 用于读取和写入流。\n"
1385+
" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )"
13621386

13631387
#: ../../howto/unicode.rst:711
13641388
msgid "Files in an Unknown Encoding"

0 commit comments

Comments
 (0)