diff --git a/library/csv.po b/library/csv.po index 8b742a9fca..97a0db8186 100644 --- a/library/csv.po +++ b/library/csv.po @@ -229,6 +229,9 @@ msgid "" "fieldnames. Regardless of how the fieldnames are determined, the dictionary " "preserves their original ordering." msgstr "" +"參數 *fieldnames* 是一個 :term:`sequence`。如果 *fieldnames* 被省略了," +"檔案 *f* 中第一列的值會被當作欄位標題。不管欄位標題是如何決定的,dictionary" +"都會保留原始的排序。" #: ../../library/csv.rst:161 msgid "" @@ -238,26 +241,31 @@ msgid "" "values are filled-in with the value of *restval* (which defaults to " "``None``)." msgstr "" +"如果一列資料中的欄位比欄位標題還多,其餘的資料及以 *restkey* (預設為 ``None``)" +"特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中的欄位比" +"欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。" #: ../../library/csv.rst:167 msgid "" "All other optional or keyword arguments are passed to the underlying :class:" "`reader` instance." msgstr "" +"所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。" #: ../../library/csv.rst:170 ../../library/csv.rst:214 msgid "" "If the argument passed to *fieldnames* is an iterator, it will be coerced to " "a :class:`list`." msgstr "" +"如果傳遞至 *fieldnames* 的引數是個疊代器,則會被迫成為一個 :class:`list`。" #: ../../library/csv.rst:172 msgid "Returned rows are now of type :class:`OrderedDict`." -msgstr "" +msgstr "回傳的列已成為型別 :class:`OrderedDict`。" #: ../../library/csv.rst:175 msgid "Returned rows are now of type :class:`dict`." -msgstr "" +msgstr "回傳的列已成為型別 :class:`dict`。" #: ../../library/csv.rst:196 msgid "" @@ -274,12 +282,23 @@ msgid "" "other optional or keyword arguments are passed to the underlying :class:" "`writer` instance." msgstr "" +"建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列上。" +"參數 *fieldnames* 是一個鍵值的 :mod:`sequence ` 且可以" +"辨識 dictionary 中傳遞至 :meth:`writerow` method 寫入至檔案 *f* 中的值。" +"如果 dictionary 中缺少了 *fieldnames* 的鍵值,則會寫入選填的參數 *restval* 的值" +"。如果傳遞至 :meth:`writerow` method 的 dictionary 包含了一個 *fieldnames* " +"中不存在的鍵值,選填的參數 *extrasaction* 可以指出該執行的動作。如果它被設定" +"為 ``'raise'``,預設會觸發 :exc:`ValueError`。如果它被設定為 ``'ignore'``," +"dictionary 中額外的值會被忽略。其他選填的引數或關鍵字引數皆會傳遞" +"至下層的 :class:`writer` 實例。" #: ../../library/csv.rst:211 msgid "" "Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " "of the :class:`DictWriter` class is not optional." msgstr "" +"請記得這不像類別 :class:`DictReader`,在類別 :class:`DictWriter` 中,參數 " +"*fieldnames* 並不是選填的。" #: ../../library/csv.rst:232 msgid "" @@ -289,6 +308,10 @@ msgid "" "subtly different CSV data. :class:`Dialect` instances define how :class:" "`reader` and :class:`writer` instances behave." msgstr "" +"類別 :class:`Dialect` 是一個容器類別,其屬性 (attribute) 包含如何處理雙引號、" +"空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出" +"有巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 " +":class:`writer` 的實例該如何表示。" #: ../../library/csv.rst:238 msgid "" @@ -296,12 +319,17 @@ msgid "" "and they can be registered with specific :class:`reader` and :class:`writer` " "classes through their initializer (``__init__``) functions like this::" msgstr "" +"所有可用的 :class:`Dialect` 名稱會透過 :func:`list_dialects` 回傳,且" +"它們可以透過特定 :class:`reader` 及 :class:`writer` 類別的" +"初始器 (initializer, ``__init__``) 函式進行註冊,就像這樣: ::" #: ../../library/csv.rst:251 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." msgstr "" +"類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的" +" dialect 名稱為 ``'excel'``。" #: ../../library/csv.rst:257 msgid "" @@ -309,6 +337,8 @@ msgid "" "generated TAB-delimited file. It is registered with the dialect name " "``'excel-tab'``." msgstr "" +"類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案" +"的慣用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。" #: ../../library/csv.rst:263 msgid "" @@ -316,14 +346,17 @@ msgid "" "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " "quoting all fields. It is registered with the dialect name ``'unix'``." msgstr "" +"類別 :class:`unix_dialect` 定義了透過 UNIX 系統產生的 CSV 檔案的慣用屬性," +"換句話說,使用 ``'\\n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的" +" dialect 名稱為 ``'unix'``。" #: ../../library/csv.rst:272 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." -msgstr "" +msgstr "類別 :class:`Sniffer` 被用來推斷 CSV 檔案的格式。" #: ../../library/csv.rst:274 msgid "The :class:`Sniffer` class provides two methods:" -msgstr "" +msgstr "類別 :class:`Sniffer` 提供了兩個 method:" #: ../../library/csv.rst:278 msgid "" @@ -331,6 +364,9 @@ msgid "" "the parameters found. If the optional *delimiters* parameter is given, it " "is interpreted as a string containing possible valid delimiter characters." msgstr "" +"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參數。" +"如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、" +"有效的分隔字符。" #: ../../library/csv.rst:286 msgid ""