1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022, Python Software Foundation
1
+ # Copyright (C) 2001-2023, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
3
#
5
4
# Translators:
6
5
# Ching-Lung Chuang, 2015
7
6
# Leon H., 2017
7
+ # Matt Wang <mattwang44@gmail.com>, 2023
8
8
msgid ""
9
9
msgstr ""
10
10
"Project-Id-Version : Python 3.12\n "
11
11
"Report-Msgid-Bugs-To : \n "
12
12
"POT-Creation-Date : 2023-07-29 00:03+0000\n "
13
- "PO-Revision-Date : 2017-09-22 18:26+0000\n "
14
- "Last-Translator : Leon H. \n "
13
+ "PO-Revision-Date : 2023-12-11 18:26+0000\n "
14
+ "Last-Translator : Matt Wang <mattwang44@gmail.com> \n "
15
15
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
16
16
"tw)\n "
17
17
"Language : zh_TW\n "
@@ -26,21 +26,25 @@ msgstr "字串轉換與格式化"
26
26
27
27
#: ../../c-api/conversion.rst:8
28
28
msgid "Functions for number conversion and formatted string output."
29
- msgstr "數字轉換函式和被格式化的字串輸出 。"
29
+ msgstr "用於數字轉換和格式化字串輸出的函式 。"
30
30
31
31
#: ../../c-api/conversion.rst:13
32
32
msgid ""
33
33
"Output not more than *size* bytes to *str* according to the format string "
34
34
"*format* and the extra arguments. See the Unix man page :manpage:"
35
35
"`snprintf(3)`."
36
36
msgstr ""
37
+ "根據格式字串 *format* 和額外引數,輸出不超過 *size* 位元組給 *str*。請參閱 "
38
+ "Unix 手冊頁面 :manpage:`snprintf(3)`。"
37
39
38
40
#: ../../c-api/conversion.rst:19
39
41
msgid ""
40
42
"Output not more than *size* bytes to *str* according to the format string "
41
43
"*format* and the variable argument list *va*. Unix man page :manpage:"
42
44
"`vsnprintf(3)`."
43
45
msgstr ""
46
+ "根據格式字串 *format* 和變數引數串列 *va*,輸出不超過 *size* 位元組給 *str*。"
47
+ "Unix 手冊頁面 :manpage:`vsnprintf(3)`。"
44
48
45
49
#: ../../c-api/conversion.rst:23
46
50
msgid ""
@@ -49,6 +53,9 @@ msgid ""
49
53
"is to guarantee consistent behavior in corner cases, which the Standard C "
50
54
"functions do not."
51
55
msgstr ""
56
+ ":c:func:`PyOS_snprintf` 和 :c:func:`PyOS_vsnprintf` 包裝標準 C 函式庫函式 :c:"
57
+ "func:`snprintf` 和 :c:func:`vsnprintf`。它們的目的是確保邊角案例 (corner "
58
+ "case) 下的行為一致,而標準 C 函式則不然。"
52
59
53
60
#: ../../c-api/conversion.rst:28
54
61
msgid ""
@@ -59,38 +66,49 @@ msgid ""
59
66
"equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine "
60
67
"the necessary buffer size."
61
68
msgstr ""
69
+ "包裝器確保回傳時 ``str[size-1]`` 始終為 ``'\\ 0'``。他們永遠不會在 str 中寫入"
70
+ "超過 *size* 位元組(包括尾隨的 ``'\\ 0'``\\ )。這兩個函式都要求 ``str != "
71
+ "NULL``、``size > 0``、``format != NULL`` 和 ``size < INT_MAX``。請注意,這表"
72
+ "示沒有與 C99 ``n = snprintf(NULL, 0, ...)`` 等效的函式來決定必要的緩衝區大"
73
+ "小。"
62
74
63
75
#: ../../c-api/conversion.rst:34
64
76
msgid ""
65
77
"The return value (*rv*) for these functions should be interpreted as follows:"
66
- msgstr "當回傳值 (*rv*) 給這些函式應該被編譯如下 :"
78
+ msgstr "這些函式的回傳值 (*rv*) 應如下被直譯 :"
67
79
68
80
#: ../../c-api/conversion.rst:36
69
81
msgid ""
70
82
"When ``0 <= rv < size``, the output conversion was successful and *rv* "
71
83
"characters were written to *str* (excluding the trailing ``'\\ 0'`` byte at "
72
84
"``str[rv]``)."
73
85
msgstr ""
86
+ "當 ``0 <= rv < size`` 時,輸出轉換成功,*rv* 字元被寫入 *str*\\ (不包括 "
87
+ "``str[rv]`` 處的尾隨 ``'\\ 0'`` 位元組)。"
74
88
75
89
#: ../../c-api/conversion.rst:40
76
90
msgid ""
77
91
"When ``rv >= size``, the output conversion was truncated and a buffer with "
78
92
"``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is "
79
93
"``'\\ 0'`` in this case."
80
94
msgstr ""
95
+ "當 ``rv >= size`` 時,輸出轉換被截斷,並且需要具有 ``rv + 1`` 位元組的緩衝區"
96
+ "才能成功。在這種情況下,``str[size-1]`` 是 ``'\\ 0'``。"
81
97
82
98
#: ../../c-api/conversion.rst:44
83
99
msgid ""
84
100
"When ``rv < 0``, \" something bad happened.\" ``str[size-1]`` is ``'\\ 0'`` in "
85
101
"this case too, but the rest of *str* is undefined. The exact cause of the "
86
102
"error depends on the underlying platform."
87
103
msgstr ""
104
+ "當 ``rv < 0`` 時,代表「有不好的事情發生了」。在這種情況下,``str[size-1]`` "
105
+ "也是 ``'\\ 0'``,但 *str* 的其餘部分未定義。錯誤的確切原因取決於底層平台。"
88
106
89
107
#: ../../c-api/conversion.rst:49
90
108
msgid ""
91
109
"The following functions provide locale-independent string to number "
92
110
"conversions."
93
- msgstr ""
111
+ msgstr "以下函式提供與區域設定無關 (locale-independent) 的字串到數字的轉換。 "
94
112
95
113
#: ../../c-api/conversion.rst:53
96
114
msgid ""
@@ -100,13 +118,18 @@ msgid ""
100
118
"have leading or trailing whitespace. The conversion is independent of the "
101
119
"current locale."
102
120
msgstr ""
121
+ "將字串 ``s`` 轉換為 :c:expr:`double`,失敗時引發 Python 例外。接受的字串集合"
122
+ "對應於 Python 的 :func:`float` 建構函式接受的字串集合,但 ``s`` 不得有前導或"
123
+ "尾隨的空格。轉換與目前區域設定無關。"
103
124
104
125
#: ../../c-api/conversion.rst:59
105
126
msgid ""
106
127
"If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:"
107
128
"`ValueError` and return ``-1.0`` if the string is not a valid representation "
108
129
"of a floating-point number."
109
130
msgstr ""
131
+ "如果 ``endptr`` 為 ``NULL``,則轉換整個字串。如果字串不是浮點數的有效表示,則"
132
+ "引發 :exc:`ValueError` 並回傳 ``-1.0``。"
110
133
111
134
#: ../../c-api/conversion.rst:63
112
135
msgid ""
@@ -116,6 +139,9 @@ msgid ""
116
139
"number, set ``*endptr`` to point to the beginning of the string, raise "
117
140
"ValueError, and return ``-1.0``."
118
141
msgstr ""
142
+ "如果 endptr 不是 ``NULL``,則盡可能轉換字串,並將 ``*endptr`` 設定為指向第一"
143
+ "個未轉換的字元。如果字串的初始片段都不是浮點數的有效表示,則設定 ``*endptr`` "
144
+ "指向字串的開頭,引發 ValueError 並回傳 ``-1.0``。"
119
145
120
146
#: ../../c-api/conversion.rst:70
121
147
msgid ""
@@ -127,49 +153,67 @@ msgid ""
127
153
"exception and return ``-1.0``. In both cases, set ``*endptr`` to point to "
128
154
"the first character after the converted value."
129
155
msgstr ""
156
+ "如果 ``s`` 表示的值太大而無法儲存在浮點數中(例如 ``\" 1e500\" `` 在許多平台上"
157
+ "都是這樣的字串),如果 ``overflow_exception`` 為 ``NULL`` 則回傳 "
158
+ "``Py_HUGE_VAL``\\ (會帶有適當的符號)並且不設定任何例外。否則, "
159
+ "``overflow_exception`` 必須指向一個 Python 例外物件;引發該例外並回傳 "
160
+ "``-1.0``。在這兩種情況下,將 ``*endptr`` 設定為指向轉換後的值之後的第一個字"
161
+ "元。"
130
162
131
163
#: ../../c-api/conversion.rst:78
132
164
msgid ""
133
165
"If any other error occurs during the conversion (for example an out-of-"
134
166
"memory error), set the appropriate Python exception and return ``-1.0``."
135
167
msgstr ""
168
+ "如果轉換期間發生任何其他錯誤(例如記憶體不足的錯誤),請設定適當的 Python 例"
169
+ "外並回傳 ``-1.0``。"
136
170
137
171
#: ../../c-api/conversion.rst:87
138
172
msgid ""
139
173
"Convert a :c:expr:`double` *val* to a string using supplied *format_code*, "
140
174
"*precision*, and *flags*."
141
175
msgstr ""
176
+ "使用提供的 *format_code*、*precision* 和 *flags* 將 :c:expr:`double` *val* 轉"
177
+ "換為字串。"
142
178
143
179
#: ../../c-api/conversion.rst:90
144
180
msgid ""
145
181
"*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, "
146
182
"``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is "
147
183
"ignored. The ``'r'`` format code specifies the standard :func:`repr` format."
148
184
msgstr ""
185
+ "*format_code* 必須是 ``'e'``、``'E'``、``'f'``、``'F'``、``'g'``、``'G'`` 或 "
186
+ "``'r'`` 其中之一。對於 ``'r'``,提供的 *precision* 必須為 0 並會被忽略。"
187
+ "``'r'`` 格式碼指定標準 :func:`repr` 格式。"
149
188
150
189
#: ../../c-api/conversion.rst:95
151
190
msgid ""
152
191
"*flags* can be zero or more of the values ``Py_DTSF_SIGN``, "
153
192
"``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:"
154
193
msgstr ""
194
+ "*flags* 可以是零個或多個值 ``Py_DTSF_SIGN``、``Py_DTSF_ADD_DOT_0`` 或 "
195
+ "``Py_DTSF_ALT``,會被聯集在一起:"
155
196
156
197
#: ../../c-api/conversion.rst:98
157
198
msgid ""
158
199
"``Py_DTSF_SIGN`` means to always precede the returned string with a sign "
159
200
"character, even if *val* is non-negative."
160
201
msgstr ""
202
+ "``Py_DTSF_SIGN`` 代表總是在回傳的字串前面加上符號字元,即使 *val* 非負數。"
161
203
162
204
#: ../../c-api/conversion.rst:101
163
205
msgid ""
164
206
"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look "
165
207
"like an integer."
166
- msgstr ""
208
+ msgstr "``Py_DTSF_ADD_DOT_0`` 代表確保回傳的字串看起來不會像整數。 "
167
209
168
210
#: ../../c-api/conversion.rst:104
169
211
msgid ""
170
212
"``Py_DTSF_ALT`` means to apply \" alternate\" formatting rules. See the "
171
213
"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details."
172
214
msgstr ""
215
+ "``Py_DTSF_ALT`` 代表要套用「備用的 (alternate)」格式化規則。有關詳細資訊,請"
216
+ "參閱 :c:func:`PyOS_snprintf` ``'#'`` 的文件。"
173
217
174
218
#: ../../c-api/conversion.rst:108
175
219
msgid ""
@@ -178,22 +222,31 @@ msgid ""
178
222
"that *val* is a finite number, an infinite number, or not a number, "
179
223
"respectively."
180
224
msgstr ""
225
+ "如果 *ptype* 是非 ``NULL``,那麼它指向的值將被設定為 ``Py_DTST_FINITE``、"
226
+ "``Py_DTST_INFINITE`` 或 ``Py_DTST_NAN`` 其中之一,分別代表 *val* 是有限數、無"
227
+ "限數或非數。"
181
228
182
229
#: ../../c-api/conversion.rst:112
183
230
msgid ""
184
231
"The return value is a pointer to *buffer* with the converted string or "
185
232
"``NULL`` if the conversion failed. The caller is responsible for freeing the "
186
233
"returned string by calling :c:func:`PyMem_Free`."
187
234
msgstr ""
235
+ "回傳值是指向 *buffer* 的指標,其中包含轉換後的字串,如果轉換失敗則回傳 "
236
+ "``NULL``。呼叫者負責透過呼叫 :c:func:`PyMem_Free` 來釋放回傳的字串。"
188
237
189
238
#: ../../c-api/conversion.rst:121
190
239
msgid ""
191
240
"Case insensitive comparison of strings. The function works almost "
192
241
"identically to :c:func:`!strcmp` except that it ignores the case."
193
242
msgstr ""
243
+ "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 相同,只是它忽"
244
+ "略大小寫。"
194
245
195
246
#: ../../c-api/conversion.rst:127
196
247
msgid ""
197
248
"Case insensitive comparison of strings. The function works almost "
198
249
"identically to :c:func:`!strncmp` except that it ignores the case."
199
250
msgstr ""
251
+ "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strncmp` 相同,只是它"
252
+ "忽略大小寫。"
0 commit comments