10000 [po] auto sync · python/python-docs-zh-cn@28f6301 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28f6301

Browse files
[po] auto sync
1 parent 9db9802 commit 28f6301

File tree

15 files changed

+12826
-12373
lines changed

15 files changed

+12826
-12373
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "80.88%", "updated_at": "2025-02-21T14:55:47Z"}
1+
{"translation": "80.95%", "updated_at": "2025-02-21T15:56:13Z"}

c-api/function.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,27 +184,27 @@ msgstr ""
184184

185185
#: ../../c-api/function.rst:148
186186
msgid "Enumeration of possible function watcher events:"
187-
msgstr ""
187+
msgstr "由可能的函数监视事件组成的枚举:"
188188

189189
#: ../../c-api/function.rst:150
190190
msgid "``PyFunction_EVENT_CREATE``"
191-
msgstr ""
191+
msgstr "``PyFunction_EVENT_CREATE``"
192192

193193
#: ../../c-api/function.rst:151
194194
msgid "``PyFunction_EVENT_DESTROY``"
195-
msgstr ""
195+
msgstr "``PyFunction_EVENT_DESTROY``"
196196

197197
#: ../../c-api/function.rst:152
198198
msgid "``PyFunction_EVENT_MODIFY_CODE``"
199-
msgstr ""
199+
msgstr "``PyFunction_EVENT_MODIFY_CODE``"
200200

201201
#: ../../c-api/function.rst:153
202202
msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``"
203-
msgstr ""
203+
msgstr "``PyFunction_EVENT_MODIFY_DEFAULTS``"
204204

205205
#: ../../c-api/function.rst:154
206206
msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``"
207-
msgstr ""
207+
msgstr "``PyFunction_EVENT_MODIFY_KWDEFAULTS``"
208208

209209
#: ../../c-api/function.rst:161
210210
msgid "Type of a function watcher callback function."

glossary.po

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,18 +1988,20 @@ msgid ""
19881988
" not like a :term:`regular package` because they have no ``__init__.py`` "
19891989
"file."
19901990
msgstr ""
1991+
"一种仅被用作子包的容器的 :term:`package`。 命名空间包可以没有实体表示物,具体而言就是不同于 :term:`regular "
1992+
"package` 因为它们没有 ``__init__.py`` 文件。"
19911993

19921994
#: ../../glossary.rst:934
19931995
msgid ""
19941996
"Namespace packages allow several individually installable packages to have a"
19951997
" common parent package. Otherwise, it is recommended to use a :term:`regular"
19961998
" package`."
1997-
msgstr ""
1999+
msgstr "命名空间包允许几个可单独安装的包具有共同的父包。 在其他情况下,则推荐使用 :term:`regular package`。"
19982000

19992001
#: ../../glossary.rst:937
20002002
msgid ""
20012003
"For more information, see :pep:`420` and :ref:`reference-namespace-package`."
2002-
msgstr ""
2004+
msgstr "要了解更多信息,请参阅 :pep:`420` 和 :ref:`reference-namespace-package`。"
20032005

20042006
#: ../../glossary.rst:939
20052007
msgid "See also :term:`module`."

howto/regex.po

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# ProgramRipper, 2023
1616
# 乐成 王, 2023
1717
# lian Wu (Wulian) <xiguawulian@gmail.com>, 2024
18-
# Freesand Leo <yuqinju@163.com>, 2024
18+
# Freesand Leo <yuqinju@163.com>, 2025
1919
#
2020
#, fuzzy
2121
msgid ""
@@ -24,7 +24,7 @@ msgstr ""
2424
"Report-Msgid-Bugs-To: \n"
2525
"POT-Creation-Date: 2025-02-21 14:16+0000\n"
2626
"PO-Revision-Date: 2021-06-28 00:53+0000\n"
27-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
27+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2828
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2929
"MIME-Version: 1.0\n"
3030
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1035,6 +1035,15 @@ msgid ""
10351035
"(22, 24)\n"
10361036
"(29, 31)"
10371037
msgstr ""
1038+
">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n"
1039+
">>> iterator\n"
1040+
"<callable_iterator object at 0x...>\n"
1041+
">>> for match in iterator:\n"
1042+
"... print(match.span())\n"
1043+
"...\n"
1044+
"(0, 2)\n"
1045+
"(22, 24)\n"
1046+
"(29, 31)"
10381047

10391048
#: ../../howto/regex.rst:495
10401049
msgid "Module-Level Functions"
@@ -1061,6 +1070,10 @@ msgid ""
10611070
">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n"
10621071
"<re.Match object; span=(0, 5), match='From '>"
10631072
msgstr ""
1073+
">>> print(re.match(r'From\\s+', 'Fromage amk'))\n"
1074+
"None\n"
1075+
">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n"
1076+
"<re.Match object; span=(0, 5), match='From '>"
10641077

10651078
#: ../../howto/regex.rst:509
10661079
msgid ""
@@ -1407,6 +1420,10 @@ msgid ""
14071420
">>> print(re.search('^From', 'Reciting From Memory'))\n"
14081421
"None"
14091422
msgstr ""
1423+
">>> print(re.search('^From', 'From Here to Eternity'))\n"
1424+
"<re.Match object; span=(0, 4), match='From'>\n"
1425+
">>> print(re.search('^From', 'Reciting From Memory'))\n"
1426+
"None"
14101427

14111428
#: ../../howto/regex.rst:719
14121429
msgid "To match a literal ``'^'``, use ``\\^``."
@@ -1431,6 +1448,12 @@ msgid ""
14311448
">>> print(re.search('}$', '{block}\\n'))\n"
14321449
"<re.Match object; span=(6, 7), match='}'>"
14331450
msgstr ""
1451+
">>> print(re.search('}$', '{block}'))\n"
1452+
"<re.Match object; span=(6, 7), match='}'>\n"
1453+
">>> print(re.search('}$', '{block} '))\n"
1454+
"None\n"
1455+
">>> print(re.search('}$', '{block}\\n'))\n"
1456+
"<re.Match object; span=(6, 7), match='}'>"
14341457

14351458
#: ../../howto/regex.rst:732
14361459
msgid ""

library/argparse.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3828,6 +3828,16 @@ msgid ""
38283828
"usage: PROG [-h] [--foo FOO]\n"
38293829
"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'"
38303830
msgstr ""
3831+
">>> import argparse\n"
3832+
">>> parser = argparse.ArgumentParser()\n"
3833+
">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n"
3834+
">>> parser.add_argument('--foo', type='hexadecimal integer')\n"
3835+
"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, default=None, type='hexadecimal integer', choices=None, required=False, help=None, metavar=None, deprecated=False)\n"
3836+
">>> parser.parse_args(['--foo', '0xFA'])\n"
3837+
"Namespace(foo=250)\n"
3838+
">>> parser.parse_args(['--foo', '1.2'])\n"
3839+
"usage: PROG [-h] [--foo FOO]\n"
3840+
"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'"
38313841

38323842
#: ../../library/argparse.rst:2149
38333843
msgid "Exceptions"

library/ctypes.po

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# zeroswan <zeroswan@outlook.com>, 2021
1313
# ProgramRipper, 2023
1414
# lian Wu (Wulian) <xiguawulian@gmail.com>, 2024
15-
# Freesand Leo <yuqinju@163.com>, 2024
15+
# Freesand Leo <yuqinju@163.com>, 2025
1616
#
1717
#, fuzzy
1818
msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121
"Report-Msgid-Bugs-To: \n"
2222
"POT-Creation-Date: 2025-02-21 14:16+0000\n"
2323
"PO-Revision-Date: 2021-06-28 01:03+0000\n"
24-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
24+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2525
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2626
"MIME-Version: 1.0\n"
2727
"Content-Type: text/plain; charset=UTF-8\n"
@@ -122,6 +122,13 @@ msgid ""
122122
">>> libc = cdll.msvcrt\n"
123123
">>>"
124124
msgstr ""
125+
">>> from ctypes import *\n"
126+
">>> print(windll.kernel32)\n"
127+
"<WinDLL 'kernel32', handle ... at ...>\n"
128+
">>> print(cdll.msvcrt)\n"
129+
"<CDLL 'msvcrt', handle ... at ...>\n"
130+
">>> libc = cdll.msvcrt\n"
131+
">>>"
125132

126133
#: ../../library/ctypes.rst:65
127134
msgid "Windows appends the usual ``.dll`` file suffix automatically."
@@ -157,6 +164,12 @@ msgid ""
157164
"<CDLL 'libc.so.6', handle ... at ...>\n"
158165
">>>"
159166
msgstr ""
167+
">>> cdll.LoadLibrary(\"libc.so.6\")\n"
168+
"<CDLL 'libc.so.6', handle ... at ...>\n"
169+
">>> libc = CDLL(\"libc.so.6\")\n"
170+
">>> libc\n"
171+
"<CDLL 'libc.so.6', handle ... at ...>\n"
172+
">>>"
160173

161174
#: ../../library/ctypes.rst:92
162175
msgid "Accessing functions from loaded dlls"
@@ -180,6 +193,17 @@ msgid ""
180193
"AttributeError: function 'MyOwnFunction' not found\n"
181194
">>>"
182195
msgstr ""
196+
">>> libc.printf\n"
197+
"<_FuncPtr object at 0x...>\n"
198+
">>> print(windll.kernel32.GetModuleHandleA)\n"
199+
"<_FuncPtr object at 0x...>\n"
200+
">>> print(windll.kernel32.MyOwnFunction)\n"
201+
"Traceback (most recent call last):\n"
202+
" File \"<stdin>\", line 1, in <module>\n"
203+
" File \"ctypes.py\", line 239, in __getattr__\n"
204+
" func = _StdcallFuncPtr(name, self)\n"
205+
"AttributeError: function 'MyOwnFunction' not found\n"
206+
">>>"
183207

184208
#: ../../library/ctypes.rst:108
185209
msgid ""
@@ -232,6 +256,9 @@ msgid ""
232256
"<_FuncPtr object at 0x...>\n"
233257
">>>"
234258
msgstr ""
259+
">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n"
260+
"<_FuncPtr object at 0x...>\n"
261+
">>>"
235262

236263
#: ../../library/ctypes.rst:133
237264
msgid ""
@@ -253,6 +280,15 @@ msgid ""
253280
"AttributeError: function ordinal 0 not found\n"
254281
">>>"
255282
msgstr ""
283+
">>> cdll.kernel32[1]\n"
284+
"<_FuncPtr object at 0x...>\n"
285+
">>> cdll.kernel32[0]\n"
286+
"Traceback (most recent call last):\n"
287+
" File \"<stdin>\", line 1, in <module>\n"
288+
" File \"ctypes.py\", line 310, in __getitem__\n"
289+
" func = _StdcallFuncPtr(name, self)\n"
290+
"AttributeError: function ordinal 0 not found\n"
291+
">>>"
256292

257293
#: ../../library/ctypes.rst:150
258294
msgid "Calling functions"
@@ -271,6 +307,8 @@ msgid ""
271307
">>> print(libc.rand())\n"
272308
"1804289383"
273309
msgstr ""
310+
">>> print(libc.rand())\n"
311+
"1804289383"
274312

275313
#: ../../library/ctypes.rst:158
276314
msgid ""

library/datetime.po

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,46 @@ msgid ""
14861486
">>> d.replace(year=2005)\n"
14871487
"datetime.date(2005, 3, 11)"
14881488
msgstr ""
1489+
">>> from datetime import date\n"
1490+
">>> d = date.fromordinal(730920) # 1. 1. 0001 之后的第 730920 天\n"
1491+
">>> d\n"
1492+
"datetime.date(2002, 3, 11)\n"
1493+
"\n"
1494+
">>> # 有关格式化字符串输出的方法\n"
1495+
">>> d.isoformat()\n"
1496+
"'2002-03-11'\n"
1497+
">>> d.strftime(\"%d/%m/%y\")\n"
1498+
"'11/03/02'\n"
1499+
">>> d.strftime(\"%A %d. %B %Y\")\n"
1500+
"'Monday 11. March 2002'\n"
1501+
">>> d.ctime()\n"
1502+
"'Mon Mar 11 00:00:00 2002'\n"
1503+
">>> 'The {1} is {0:%d}, the {2} is {0:%B}.'.format(d, \"day\", \"month\")\n"
1504+
"'The day is 11, the month is March.'\n"
1505+
"\n"
1506+
">>> # 用于提取不同历法中的‘部分’的方法\n"
1507+
">>> t = d.timetuple()\n"
1508+
">>> for i in t:\n"
1509+
"... print(i)\n"
1510+
"2002 # 年\n"
1511+
"3 # 月\n"
1512+
"11 # 日\n"
1513+
"0\n"
1514+
"0\n"
1515+
"0\n"
1516+
"0 # 周序号 (0 = 星期一)\n"
1517+
"70 # 当年的第 70 天\n"
1518+
"-1\n"
1519+
">>> ic = d.isocalendar()\n"
1520+
">>> for i in ic:\n"
1521+
"... print(i)\n"
1522+
"2002 # ISO 年\n"
1523+
"11 # ISO 第几周\n"
1524+
"1 # ISO 周序号 ( 1 = 星期一 )\n"
1525+
"\n"
1526+
">>> # 日期对象是不可变的;所有操作都将产生一个新对象\n"
1527+
">>> d.replace(year=2005)\n"
1528+
"datetime.date(2005, 3, 11)"
14891529

14901530
#: ../../library/datetime.rst:857
14911531
msgid ":class:`.datetime` Objects"
@@ -1843,6 +1883,26 @@ msgid ""
18431883
"datetime.datetime(2011, 11, 4, 0, 5, 23,\n"
18441884
" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))"
18451885
msgstr ""
1886+
">>> from datetime import datetime\n"
1887+
">>> datetime.fromisoformat('2011-11-04')\n"
1888+
"datetime.datetime(2011, 11, 4, 0, 0)\n"
1889+
">>> datetime.fromisoformat('20111104')\n"
1890+
"datetime.datetime(2011, 11, 4, 0, 0)\n"
1891+
">>> datetime.fromisoformat('2011-11-04T00:05:23')\n"
1892+
"datetime.datetime(2011, 11, 4, 0, 5, 23)\n"
1893+
">>> datetime.fromisoformat('2011-11-04T00:05:23Z')\n"
1894+
"datetime.datetime(2011, 11, 4, 0, 5, 23, tzinfo=datetime.timezone.utc)\n"
1895+
">>> datetime.fromisoformat('20111104T000523')\n"
1896+
"datetime.datetime(2011, 11, 4, 0, 5, 23)\n"
1897+
">>> datetime.fromisoformat('2011-W01-2T00:05:23.283')\n"
1898+
"datetime.datetime(2011, 1, 4, 0, 5, 23, 283000)\n"
1899+
">>> datetime.fromisoformat('2011-11-04 00:05:23.283')\n"
1900+
"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n"
1901+
">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n"
1902+
"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone.utc)\n"
1903+
">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n"
1904+
"datetime.datetime(2011, 11, 4, 0, 5, 23,\n"
1905+
" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))"
18461906

18471907
#: ../../library/datetime.rst:1078
18481908
msgid ""
@@ -1911,6 +1971,11 @@ msgid ""
19111971
">>> when.strftime(\"%B %d\")\n"
19121972
"'February 29'"
19131973
msgstr ""
1974+
">>> from datetime import datetime\n"
1975+
">>> date_string = \"02/29\"\n"
1976+
">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # Avoids leap year bug.\n"
1977+
">>> when.strftime(\"%B %d\")\n"
1978+
"'February 29'"
19141979

19151980
#: ../../library/datetime.rst:1130
19161981
msgid ""
@@ -2586,6 +2651,12 @@ msgid ""
25862651
">>> dt.isoformat(timespec='microseconds')\n"
25872652
"'2015-01-01T12:30:59.000000'"
25882653
msgstr ""
2654+
">>> from datetime import datetime\n"
2655+
">>> datetime.now().isoformat(timespec='minutes')\n"
2656+
"'2002-12-25T00:00'\n"
2657+
">>> dt = datetime(2015, 1, 1, 12, 30, 59, 0)\n"
2658+
">>> dt.isoformat(timespec='microseconds')\n"
2659+
"'2015-01-01T12:30:59.000000'"
25892660

25902661
#: ../../library/datetime.rst:1570 ../../library/datetime.rst:1948
25912662
msgid "Added the *timespec* parameter."
@@ -2705,6 +2776,54 @@ msgid ""
27052776
">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(dt, \"day\", \"month\", \"time\")\n"
27062777
"'The day is 21, the month is November, the time is 04:30PM.'"
27072778
msgstr ""
2779+
">>> from datetime import datetime, date, time, timezone\n"
2780+
"\n"
2781+
">>> # 使用 datetime.combine()\n"
2782+
">>> d = date(2005, 7, 14)\n"
2783+
">>> t = time(12, 30)\n"
2784+
">>> datetime.combine(d, t)\n"
2785+
"datetime.datetime(2005, 7, 14, 12, 30)\n"
2786+
"\n"
2787+
">>> # 使用 datetime.now()\n"
2788+
">>> datetime.now()\n"
2789+
"datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n"
2790+
">>> datetime.now(timezone.utc)\n"
2791+
"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone.utc)\n"
2792+
"\n"
2793+
">>> # 使用 datetime.strptime()\n"
2794+
">>> dt = datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:%M\")\n"
2795+
">>> dt\n"
2796+
"datetime.datetime(2006, 11, 21, 16, 30)\n"
2797+
"\n"
2798+
">>> # 使用 datetime.timetuple() 来获取由所有属性组成的元组\n"
2799+
">>> tt = dt.timetuple()\n"
2800+
">>> for it in tt:\n"
2801+
"... print(it)\n"
2802+
"...\n"
2803+
"2006 # 年\n"
2804+
"11 # 月\n"
2805+
"21 # 日\n"
2806+
"16 # 时\n"
2807+
"30 # 分\n"
2808+
"0 # 秒\n"
2809+
"1 # 周序号 (0 = 星期一)\n"
2810+
"325 # 自 1 月 1 日开始的天数\n"
2811+
"-1 # dst - 方法 tzinfo.dst() 返回 None\n"
2812+
"\n"
2813+
">>> # ISO 格式的日期\n"
2814+
">>> ic = dt.isocalendar()\n"
2815+
">>> for it in ic:\n"
2816+
"... print(it)\n"
2817+
"...\n"
2818+
"2006 # ISO 年\n"
2819+
"47 # ISO 第几周\n"
2820+
"2 # ISO 周序号\n"
2821+
"\n"
2822+
">>> # 格式化日期时间对象\n"
2823+
">>> dt.strftime(\"%A, %d. %B %Y %I:%M%p\")\n"
2824+
"'Tuesday, 21. November 2006 04:30PM'\n"
2825+
">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(dt, \"day\", \"month\", \"time\")\n"
2826+
"'The day is 21, the month is November, the time is 04:30PM.'"
27082827

27092828
#: ../../library/datetime.rst:1671
27102829
msgid ""

0 commit comments

Comments
 (0)
0