Skip to content

Commit 3a037c0

Browse files
authored
Translate CSV Library from rst:156 to rst:278 (#590)
* Traslate CSV Module from rst:156 to rst:278 * Fix Conplie Issue * Fix with Reviewer's Comments
1 parent dd4e9fb commit 3a037c0

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

library/csv.po

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ msgid ""
229229
"fieldnames. Regardless of how the fieldnames are determined, the dictionary "
230230
"preserves their original ordering."
231231
msgstr ""
232+
"參數 *fieldnames* 是一個 :term:`sequence`。如果 *fieldnames* 被省略了,"
233+
"檔案 *f* 中第一列的值會被當作欄位標題。不管欄位標題是如何決定的,dictionary"
234+
"都會保留原始的排序。"
232235

233236
#: ../../library/csv.rst:161
234237
msgid ""
@@ -238,26 +241,31 @@ msgid ""
238241
"values are filled-in with the value of *restval* (which defaults to "
239242
"``None``)."
240243
msgstr ""
244+
"如果一列資料中的欄位比欄位標題還多,其餘的資料及以 *restkey* (預設為 ``None``)"
245+
"特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中的欄位比"
246+
"欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。"
241247

242248
#: ../../library/csv.rst:167
243249
msgid ""
244250
"All other optional or keyword arguments are passed to the underlying :class:"
245251
"`reader` instance."
246252
msgstr ""
253+
"所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。"
247254

248255
#: ../../library/csv.rst:170 ../../library/csv.rst:214
249256
msgid ""
250257
"If the argument passed to *fieldnames* is an iterator, it will be coerced to "
251258
"a :class:`list`."
252259
msgstr ""
260+
"如果傳遞至 *fieldnames* 的引數是個疊代器,則會被迫成為一個 :class:`list`。"
253261

254262
#: ../../library/csv.rst:172
255263
msgid "Returned rows are now of type :class:`OrderedDict`."
256-
msgstr ""
264+
msgstr "回傳的列已成為型別 :class:`OrderedDict`。"
257265

258266
#: ../../library/csv.rst:175
259267
msgid "Returned rows are now of type :class:`dict`."
260-
msgstr ""
268+
msgstr "回傳的列已成為型別 :class:`dict`。"
261269

262270
#: ../../library/csv.rst:196
263271
msgid ""
@@ -274,12 +282,23 @@ msgid ""
274282
"other optional or keyword arguments are passed to the underlying :class:"
275283
"`writer` instance."
276284
msgstr ""
285+
"建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列上。"
286+
"參數 *fieldnames* 是一個鍵值的 :mod:`sequence <collections.abc>` 且可以"
287+
"辨識 dictionary 中傳遞至 :meth:`writerow` method 寫入至檔案 *f* 中的值。"
288+
"如果 dictionary 中缺少了 *fieldnames* 的鍵值,則會寫入選填的參數 *restval* 的值"
289+
"。如果傳遞至 :meth:`writerow` method 的 dictionary 包含了一個 *fieldnames* "
290+
"中不存在的鍵值,選填的參數 *extrasaction* 可以指出該執行的動作。如果它被設定"
291+
"為 ``'raise'``,預設會觸發 :exc:`ValueError`。如果它被設定為 ``'ignore'``,"
292+
"dictionary 中額外的值會被忽略。其他選填的引數或關鍵字引數皆會傳遞"
293+
"至下層的 :class:`writer` 實例。"
277294

278295
#: ../../library/csv.rst:211
279296
msgid ""
280297
"Note that unlike the :class:`DictReader` class, the *fieldnames* parameter "
281298
"of the :class:`DictWriter` class is not optional."
282299
msgstr ""
300+
"請記得這不像類別 :class:`DictReader`,在類別 :class:`DictWriter` 中,參數 "
301+
"*fieldnames* 並不是選填的。"
283302

284303
#: ../../library/csv.rst:232
285304
msgid ""
@@ -289,48 +308,65 @@ msgid ""
289308
"subtly different CSV data. :class:`Dialect` instances define how :class:"
290309
"`reader` and :class:`writer` instances behave."
291310
msgstr ""
311+
"類別 :class:`Dialect` 是一個容器類別,其屬性 (attribute) 包含如何處理雙引號、"
312+
"空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出"
313+
"有巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 "
314+
":class:`writer` 的實例該如何表示。"
292315

293316
#: ../../library/csv.rst:238
294317
msgid ""
295318
"All available :class:`Dialect` names are returned by :func:`list_dialects`, "
296319
"and they can be registered with specific :class:`reader` and :class:`writer` "
297320
"classes through their initializer (``__init__``) functions like this::"
298321
msgstr ""
322+
"所有可用的 :class:`Dialect` 名稱會透過 :func:`list_dialects` 回傳,且"
323+
"它們可以透過特定 :class:`reader` 及 :class:`writer` 類別的"
324+
"初始器 (initializer, ``__init__``) 函式進行註冊,就像這樣: ::"
299325

300326
#: ../../library/csv.rst:251
301327
msgid ""
302328
"The :class:`excel` class defines the usual properties of an Excel-generated "
303329
"CSV file. It is registered with the dialect name ``'excel'``."
304330
msgstr ""
331+
"類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的"
332+
" dialect 名稱為 ``'excel'``。"
305333

306334
#: ../../library/csv.rst:257
307335
msgid ""
308336
"The :class:`excel_tab` class defines the usual properties of an Excel-"
309337
"generated TAB-delimited file. It is registered with the dialect name "
310338
"``'excel-tab'``."
311339
msgstr ""
340+
"類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案"
341+
"的慣用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。"
312342

313343
#: ../../library/csv.rst:263
314344
msgid ""
315345
"The :class:`unix_dialect` class defines the usual properties of a CSV file "
316346
"generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and "
317347
"quoting all fields. It is registered with the dialect name ``'unix'``."
318348
msgstr ""
349+
"類別 :class:`unix_dialect` 定義了透過 UNIX 系統產生的 CSV 檔案的慣用屬性,"
350+
"換句話說,使用 ``'\\n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的"
351+
" dialect 名稱為 ``'unix'``。"
319352

320353
#: ../../library/csv.rst:272
321354
msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file."
322-
msgstr ""
355+
msgstr "類別 :class:`Sniffer` 被用來推斷 CSV 檔案的格式。"
323356

324357
#: ../../library/csv.rst:274
325358
msgid "The :class:`Sniffer` class provides two methods:"
326-
msgstr ""
359+
msgstr "類別 :class:`Sniffer` 提供了兩個 method:"
327360

328361
#: ../../library/csv.rst:278
329362
msgid ""
330363
"Analyze the given *sample* and return a :class:`Dialect` subclass reflecting "
331364
"the parameters found. If the optional *delimiters* parameter is given, it "
332365
"is interpreted as a string containing possible valid delimiter characters."
333366
msgstr ""
367+
"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參數。"
368+
"如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、"
369+
"有效的分隔字符。"
334370

335371
#: ../../library/csv.rst:286
336372
msgid ""

0 commit comments

Comments
 (0)