Skip to content

Commit 7aafd31

Browse files
committed
chore: resolve fuzzy entries and add simple translation
1 parent 509bb5d commit 7aafd31

31 files changed

+4842
-4507
lines changed

c-api/dict.po

+70-62
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ msgid ""
3434
"This instance of :c:type:`PyTypeObject` represents the Python dictionary "
3535
"type. This is the same object as :class:`dict` in the Python layer."
3636
msgstr ""
37-
":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中的 :"
38-
"class:`dict` 為同一個物件。"
37+
":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中"
38+
"的 :class:`dict` 為同一個物件。"
3939

4040
#: ../../c-api/dict.rst:24
4141
msgid ""
@@ -77,9 +77,9 @@ msgstr ""
7777

7878
#: ../../c-api/dict.rst:60
7979
msgid ""
80-
"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :"
81-
"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
82-
"`PyObject*`."
80+
"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as "
81+
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
82+
"a :c:expr:`PyObject*`."
8383
msgstr ""
8484

8585
#: ../../c-api/dict.rst:69
@@ -88,32 +88,32 @@ msgstr ""
8888

8989
#: ../../c-api/dict.rst:74
9090
msgid ""
91-
"Insert *val* into the dictionary *p* with a key of *key*. *key* must be :"
92-
"term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` "
93-
"on success or ``-1`` on failure. This function *does not* steal a reference "
94-
"to *val*."
91+
"Insert *val* into the dictionary *p* with a key of *key*. *key* must "
92+
"be :term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return "
93+
"``0`` on success or ``-1`` on failure. This function *does not* steal a "
94+
"reference to *val*."
9595
msgstr ""
9696

9797
#: ../../c-api/dict.rst:82
9898
msgid ""
99-
"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:"
100-
"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
101-
"`PyObject*`."
99+
"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as "
100+
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
101+
"a :c:expr:`PyObject*`."
102102
msgstr ""
103103

104104
#: ../../c-api/dict.rst:89
105105
msgid ""
106-
"Remove the entry in dictionary *p* with key *key*. *key* must be :term:"
107-
"`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the "
108-
"dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on "
109-
"failure."
106+
"Remove the entry in dictionary *p* with key *key*. *key* must "
107+
"be :term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is "
108+
"not in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or "
109+
"``-1`` on failure."
110110
msgstr ""
111111

112112
#: ../../c-api/dict.rst:97
113113
msgid ""
114-
"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:"
115-
"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
116-
"`PyObject*`."
114+
"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as "
115+
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
116+
"a :c:expr:`PyObject*`."
117117
msgstr ""
118118

119119
#: ../../c-api/dict.rst:104
@@ -134,11 +134,11 @@ msgstr ""
134134

135135
#: ../../c-api/dict.rst:110 ../../c-api/dict.rst:207
136136
msgid "On error, raise an exception and return ``-1``."
137-
msgstr ""
137+
msgstr "錯誤發生時,引發一個例外並回傳 ``-1``。"
138138

139139
#: ../../c-api/dict.rst:114
140140
msgid "See also the :c:func:`PyObject_GetItem` function."
141-
msgstr ""
141+
msgstr "另見 :c:func:`PyObject_GetItem` 函式。"
142142

143143
#: ../../c-api/dict.rst:119
144144
msgid ""
@@ -149,9 +149,9 @@ msgstr ""
149149

150150
#: ../../c-api/dict.rst:125
151151
msgid ""
152-
"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:"
153-
"`~object.__eq__` methods are silently ignored. Prefer the :c:func:"
154-
"`PyDict_GetItemWithError` function instead."
152+
"Exceptions that occur while this calls :meth:`~object.__hash__` "
153+
"and :meth:`~object.__eq__` methods are silently ignored. Prefer "
154+
"the :c:func:`PyDict_GetItemWithError` function instead."
155155
msgstr ""
156156

157157
#: ../../c-api/dict.rst:129
@@ -169,23 +169,25 @@ msgstr ""
169169

170170
#: ../../c-api/dict.rst:144
171171
msgid ""
172-
"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:"
173-
"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
174-
"`PyObject*`."
172+
"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as "
173+
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
174+
"a :c:expr:`PyObject*`."
175175
msgstr ""
176176

177177
#: ../../c-api/dict.rst:150
178178
msgid ""
179-
"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:"
180-
"`~object.__eq__` methods or while creating the temporary :class:`str` object "
181-
"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` "
182-
"function with your own :c:func:`PyUnicode_FromString` *key* instead."
179+
"Exceptions that occur while this calls :meth:`~object.__hash__` "
180+
"and :meth:`~object.__eq__` methods or while creating the "
181+
"temporary :class:`str` object are silently ignored. Prefer using "
182+
"the :c:func:`PyDict_GetItemWithError` function with your "
183+
"own :c:func:`PyUnicode_FromString` *key* instead."
183184
msgstr ""
184185

185186
#: ../../c-api/dict.rst:159
186187
msgid ""
187-
"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:"
188-
"`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`."
188+
"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as "
189+
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
190+
"a :c:expr:`PyObject*`."
189191
msgstr ""
190192

191193
#: ../../c-api/dict.rst:168
@@ -238,8 +240,8 @@ msgstr ""
238240

239241
#: ../../c-api/dict.rst:209
240242
msgid ""
241-
"Similar to :meth:`dict.pop`, but without the default value and not raising :"
242-
"exc:`KeyError` if the key missing."
243+
"Similar to :meth:`dict.pop`, but without the default value and not "
244+
"raising :exc:`KeyError` if the key missing."
243245
msgstr ""
244246

245247
#: ../../c-api/dict.rst:217
@@ -251,37 +253,37 @@ msgstr ""
251253
#: ../../c-api/dict.rst:226
252254
msgid ""
253255
"Return a :c:type:`PyListObject` containing all the items from the dictionary."
254-
msgstr ""
256+
msgstr "回傳一個包含字典中所有項目的 :c:type:`PyListObject`。"
255257

256258
#: ../../c-api/dict.rst:231
257259
msgid ""
258260
"Return a :c:type:`PyListObject` containing all the keys from the dictionary."
259-
msgstr ""
261+
msgstr "回傳一個包含字典中所有鍵的 :c:type:`PyListObject`。"
260262

261263
#: ../../c-api/dict.rst:236
262264
msgid ""
263265
"Return a :c:type:`PyListObject` containing all the values from the "
264266
"dictionary *p*."
265-
msgstr ""
267+
msgstr "回傳一個包含字典 *p* 中所有值的 :c:type:`PyListObject`。"
266268

267269
#: ../../c-api/dict.rst:244
268270
msgid ""
269271
"Return the number of items in the dictionary. This is equivalent to "
270272
"``len(p)`` on a dictionary."
271-
msgstr ""
273+
msgstr "回傳字典中項目的數量。此與於字典呼叫 ``len(p)`` 等效。"
272274

273275
#: ../../c-api/dict.rst:250
274276
msgid ""
275-
"Iterate over all key-value pairs in the dictionary *p*. The :c:type:"
276-
"`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the "
277-
"first call to this function to start the iteration; the function returns "
278-
"true for each pair in the dictionary, and false once all pairs have been "
279-
"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:"
280-
"`PyObject*` variables that will be filled in with each key and value, "
281-
"respectively, or may be ``NULL``. Any references returned through them are "
282-
"borrowed. *ppos* should not be altered during iteration. Its value "
283-
"represents offsets within the internal dictionary structure, and since the "
284-
"structure is sparse, the offsets are not consecutive."
277+
"Iterate over all key-value pairs in the dictionary *p*. "
278+
"The :c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` "
279+
"prior to the first call to this function to start the iteration; the "
280+
"function returns true for each pair in the dictionary, and false once all "
281+
"pairs have been reported. The parameters *pkey* and *pvalue* should either "
282+
"point to :c:expr:`PyObject*` variables that will be filled in with each key "
283+
"and value, respectively, or may be ``NULL``. Any references returned "
284+
"through them are borrowed. *ppos* should not be altered during iteration. "
285+
"Its value represents offsets within the internal dictionary structure, and "
286+
"since the structure is sparse, the offsets are not consecutive."
285287
msgstr ""
286288

287289
#: ../../c-api/dict.rst:261
@@ -347,8 +349,9 @@ msgstr ""
347349
#: ../../c-api/dict.rst:293
348350
msgid ""
349351
"The function is not thread-safe in the :term:`free-threaded <free "
350-
"threading>` build without external synchronization. You can use :c:macro:"
351-
"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::"
352+
"threading>` build without external synchronization. You can "
353+
"use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while "
354+
"iterating over it::"
352355
msgstr ""
353356

354357
#: ../../c-api/dict.rst:298
@@ -359,6 +362,11 @@ msgid ""
359362
"}\n"
360363
"Py_END_CRITICAL_SECTION();"
361364
msgstr ""
365+
"Py_BEGIN_CRITICAL_SECTION(self->dict);\n"
366+
"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
367+
" ...\n"
368+
"}\n"
369+
"Py_END_CRITICAL_SECTION();"
362370

363371
#: ../../c-api/dict.rst:307
364372
msgid ""
@@ -372,10 +380,10 @@ msgstr ""
372380

373381
#: ../../c-api/dict.rst:317
374382
msgid ""
375-
"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a."
376-
"update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back "
377-
"to the iterating over a sequence of key value pairs if the second argument "
378-
"has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
383+
"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to "
384+
"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall "
385+
"back to the iterating over a sequence of key value pairs if the second "
386+
"argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
379387
"exception was raised."
380388
msgstr ""
381389

@@ -410,15 +418,15 @@ msgstr ""
410418

411419
#: ../../c-api/dict.rst:349
412420
msgid ""
413-
"Clear watcher identified by *watcher_id* previously returned from :c:func:"
414-
"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the "
415-
"given *watcher_id* was never registered.)"
421+
"Clear watcher identified by *watcher_id* previously returned "
422+
"from :c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error "
423+
"(e.g. if the given *watcher_id* was never registered.)"
416424
msgstr ""
417425

418426
#: ../../c-api/dict.rst:357
419427
msgid ""
420-
"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:"
421-
"func:`PyDict_AddWatcher` will be called when *dict* is modified or "
428+
"Mark dictionary *dict* as watched. The callback granted *watcher_id* "
429+
"by :c:func:`PyDict_AddWatcher` will be called when *dict* is modified or "
422430
"deallocated. Return ``0`` on success or ``-1`` on error."
423431
msgstr ""
424432

@@ -484,8 +492,8 @@ msgstr ""
484492
#: ../../c-api/dict.rst:409
485493
msgid ""
486494
"If the callback sets an exception, it must return ``-1``; this exception "
487-
"will be printed as an unraisable exception using :c:func:"
488-
"`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
495+
"will be printed as an unraisable exception "
496+
"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
489497
msgstr ""
490498

491499
#: ../../c-api/dict.rst:413

0 commit comments

Comments
 (0)