Skip to content

Commit ff8005f

Browse files
authored
Update library/csv (#692)
* Update * Fix error * Update with Reviewer's Commnet
1 parent 430edde commit ff8005f

File tree

1 file changed

+80
-24
lines changed

1 file changed

+80
-24
lines changed

library/csv.po

+80-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
11-
"PO-Revision-Date: 2023-09-10 10:26+0800\n"
11+
"PO-Revision-Date: 2023-11-08 15:06+0800\n"
1212
"Last-Translator: RockLeon <therockleona@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
@@ -17,7 +17,7 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=1; plural=0;\n"
20-
"X-Generator: Poedit 3.3.2\n"
20+
"X-Generator: Poedit 3.4\n"
2121

2222
#: ../../library/csv.rst:2
2323
msgid ":mod:`csv` --- CSV File Reading and Writing"
@@ -360,7 +360,7 @@ msgid ""
360360
msgstr ""
361361
"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參"
362362
"數。如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、有效的分"
363-
"隔字符。"
363+
"隔字元。"
364364

365365
#: ../../library/csv.rst:286
366366
msgid ""
@@ -507,15 +507,21 @@ msgid ""
507507
"specify individual formatting parameters, which have the same names as the "
508508
"attributes defined below for the :class:`Dialect` class."
509509
msgstr ""
510+
"為了讓指定輸入及輸出紀錄的格式更方便,特定的格式化參數會被組成 dialect。一個 "
511+
"dialect 是 :class:`Dialect` class 的子類別,其有一組特定的方法及單獨的 :meth:"
512+
"`validate` 方法。當建立 :class:`reader` 或 :class:`writer` 物件時,程式設計師"
513+
"可以指定一個字串或是一個 :class:`Dialect` 的子類別作為 dialect 參數。此外,或"
514+
"是作為替代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其"
515+
"與 :class:`Dialect` 類別定義的屬性具有相同的名字。"
510516

511517
#: ../../library/csv.rst:382
512518
msgid "Dialects support the following attributes:"
513-
msgstr ""
519+
msgstr "Dialect 支援下列屬性:"
514520

515521
#: ../../library/csv.rst:387
516522
msgid ""
517523
"A one-character string used to separate fields. It defaults to ``','``."
518-
msgstr ""
524+
msgstr "一個單一字元 (one-character) 的字串可已用來分割欄位。預設為 ``','``。"
519525

520526
#: ../../library/csv.rst:392
521527
msgid ""
@@ -524,12 +530,17 @@ msgid ""
524530
"const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It "
525531
"defaults to :const:`True`."
526532
msgstr ""
533+
"控制 *quotechar* 的實例何時出現在欄位之中,並讓它們自己被放在引號之內。當屬性"
534+
"為 :const:`True`,字元會是雙引號。若為 :const:`False`,在 *quotechar* 之前會"
535+
"先使用 *escapechar* 作為前綴字。預設為 :const:`True`。"
527536

528537
#: ../../library/csv.rst:397
529538
msgid ""
530539
"On output, if *doublequote* is :const:`False` and no *escapechar* is set, :"
531540
"exc:`Error` is raised if a *quotechar* is found in a field."
532541
msgstr ""
542+
"在輸出時,若 *doublequote* 是 :const:`False` 且\\ *逸出字元*\\ 沒有被設定,當"
543+
"一個\\ *引號*\\ 在欄位中被發現時,:exc:`Error` 會被引發。"
533544

534545
#: ../../library/csv.rst:403
535546
msgid ""
@@ -539,63 +550,79 @@ msgid ""
539550
"from the following character. It defaults to :const:`None`, which disables "
540551
"escaping."
541552
msgstr ""
553+
"一個會被寫入器使用的單一字元的字串,當 *quoting* 設定為 :const:`QUOTE_NONE` "
554+
"時逸出\\ *分隔符號*\\ ;當 *doublequote* 設定為 :const:`False` 時逸出\\ *引號"
555+
"*\\ 。在讀取時,\\ *逸出字元*\\ 會移除後面的字元以及任何特殊意義。預設為 :"
556+
"const:`None`,表示禁止逸出。"
542557

543558
#: ../../library/csv.rst:408
544559
msgid "An empty *escapechar* is not allowed."
545-
msgstr ""
560+
msgstr "*escapechar* 為空是不被接受的。"
546561

547562
#: ../../library/csv.rst:413
548563
msgid ""
549564
"The string used to terminate lines produced by the :class:`writer`. It "
550565
"defaults to ``'\\r\\n'``."
551-
msgstr ""
566+
msgstr "由 :class:`writer` 產生被用來分行的字串。預設為 ``'\\r\\n'``。"
552567

553568
#: ../../library/csv.rst:418
554569
msgid ""
555570
"The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` "
556571
"as end-of-line, and ignores *lineterminator*. This behavior may change in "
557572
"the future."
558573
msgstr ""
574+
":class:`reader`是 hard-coded 辨別 ``'\\r'`` or ``'\\n'`` 作為行尾 (end-of-"
575+
"line),並忽略\\ *分行符號*\\ 。未來可能會改變這個行為。"
559576

560577
#: ../../library/csv.rst:425
561578
msgid ""
562579
"A one-character string used to quote fields containing special characters, "
563580
"such as the *delimiter* or *quotechar*, or which contain new-line "
564581
"characters. It defaults to ``'\"'``."
565582
msgstr ""
583+
"一個單一字元的字串被用於引用包含特殊字元的欄位,像是 *delimiter*、"
584+
"*quotechar* 或是換行字元。預設為 ``'\"'``。"
566585

567586
#: ../../library/csv.rst:429
568587
msgid "An empty *quotechar* is not allowed."
569-
msgstr ""
588+
msgstr "*quotechar* 為空是不被允許的。"
570589

571590
#: ../../library/csv.rst:434
572591
msgid ""
573592
"Controls when quotes should be generated by the writer and recognised by the "
574593
"reader. It can take on any of the :const:`QUOTE_\\*` constants (see "
575594
"section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`."
576595
msgstr ""
596+
"控制 writer 何時產生引號,以及 reader 如何辨識引號。他可以使用任何 :const:"
597+
"`QUOTE_\\*` 常數(請見段落 :ref:`csv-contents`)且預設為 :const:"
598+
"`QUOTE_MINIMAL`。"
577599

578600
#: ../../library/csv.rst:441
579601
msgid ""
580602
"When :const:`True`, spaces immediately following the *delimiter* are "
581603
"ignored. The default is :const:`False`."
582604
msgstr ""
605+
"若為 :const:`True`,在緊接著\\ *分隔符號*\\ 後的空格會被忽略。預設為 :const:"
606+
"`False`。"
583607

584608
#: ../../library/csv.rst:447
585609
msgid ""
586610
"When ``True``, raise exception :exc:`Error` on bad CSV input. The default is "
587611
"``False``."
588612
msgstr ""
613+
"若為 ``True``,若有錯誤的 CSV 輸入則會引發 :exc:`Error`。預設為 ``False``。"
589614

590615
#: ../../library/csv.rst:451
591616
msgid "Reader Objects"
592-
msgstr ""
617+
msgstr "讀取器物件"
593618

594619
#: ../../library/csv.rst:453
595620
msgid ""
596621
"Reader objects (:class:`DictReader` instances and objects returned by the :"
597622
"func:`reader` function) have the following public methods:"
598623
msgstr ""
624+
"讀取器物件(:func:`reader` 函式回傳的 :class:`DictReader` 實例與物件)有下列"
625+
"公用方法 (public method):"
599626

600627
#: ../../library/csv.rst:458
601628
msgid ""
@@ -604,34 +631,39 @@ msgid ""
604631
"instance), parsed according to the current :class:`Dialect`. Usually you "
605632
"should call this as ``next(reader)``."
606633
msgstr ""
634+
"回傳一個列表為讀入器的可疊代物件的下一列內容(若該物件是由 :func:`reader` 回"
635+
"傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據當前的 :class:"
636+
"`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。"
607637

608638
#: ../../library/csv.rst:464
609639
msgid "Reader objects have the following public attributes:"
610-
msgstr ""
640+
msgstr "讀取器物件有下列公用屬性 (public attributes):"
611641

612642
#: ../../library/csv.rst:468
613643
msgid "A read-only description of the dialect in use by the parser."
614-
msgstr ""
644+
msgstr "dialect 的唯讀敘述,會被剖析器使用。"
615645

616646
#: ../../library/csv.rst:473
617647
msgid ""
618648
"The number of lines read from the source iterator. This is not the same as "
619649
"the number of records returned, as records can span multiple lines."
620-
msgstr ""
650+
msgstr "來源疊代器所讀取的行數。這與回傳的紀錄數不同,因為可以進行跨行紀錄。"
621651

622652
#: ../../library/csv.rst:477
623653
msgid "DictReader objects have the following public attribute:"
624-
msgstr ""
654+
msgstr "DictReader 物件有下列公用屬性:"
625655

626656
#: ../../library/csv.rst:481
627657
msgid ""
628658
"If not passed as a parameter when creating the object, this attribute is "
629659
"initialized upon first access or when the first record is read from the file."
630660
msgstr ""
661+
"若在建立物件時沒有作為參數傳遞,這個屬性會在第一次存取之前或是第一筆資料被讀"
662+
"取之前進行初始化 (initialize)。"
631663

632664
#: ../../library/csv.rst:488
633665
msgid "Writer Objects"
634-
msgstr ""
666+
msgstr "寫入器物件"
635667

636668
#: ../../library/csv.rst:490
637669
msgid ""
@@ -644,65 +676,80 @@ msgid ""
644676
"problems for other programs which read CSV files (assuming they support "
645677
"complex numbers at all)."
646678
msgstr ""
679+
":class:`Writer` 物件(:func:`writer` 函式回傳的 :class:`DictWriter` 實例與物"
680+
"件)有下列公用方法。對於 :class:`Writer` 物件而言,一個\\ *列*\\ 中必須為一個"
681+
"可疊代的字串或是數字;對於 :class:`DictWriter` 物件而言,則必須為一個 "
682+
"dictionary ,且可以對應欄位標題至字串或數字(會先透過 :func:`str` 進行傳"
683+
"遞)。請注意,在寫入複數 (complex number) 時會用小括號 (parens) 包起來。這可"
684+
"能在其他程式讀取 CSV 檔案時導致某些問題(假設他們完全支援複雜數字)。"
647685

648686
#: ../../library/csv.rst:501
649687
msgid ""
650688
"Write the *row* parameter to the writer's file object, formatted according "
651689
"to the current :class:`Dialect`. Return the return value of the call to the "
652690
"*write* method of the underlying file object."
653691
msgstr ""
692+
"將參數 *row* 寫入至寫入器的檔案物件中,並依照當前的 :class:`Dialect` 進行格式"
693+
"化。回傳下層檔案物件 *write* 方法的回傳值。"
654694

655695
#: ../../library/csv.rst:505
656696
msgid "Added support of arbitrary iterables."
657-
msgstr "新增對任意 iterable 的支援。"
697+
msgstr "新增對任意可疊代物件 (arbitrary iterables) 的支援。"
658698

659699
#: ../../library/csv.rst:510
660700
msgid ""
661701
"Write all elements in *rows* (an iterable of *row* objects as described "
662702
"above) to the writer's file object, formatted according to the current "
663703
"dialect."
664704
msgstr ""
705+
"將 *rows* 中所有元素(為上述的一個可疊代的 *row* 物件)寫入至寫入器的檔案物件"
706+
"中,並依照當前的 dialect 進行格式化。"
665707

666708
#: ../../library/csv.rst:514
667709
msgid "Writer objects have the following public attribute:"
668-
msgstr ""
710+
msgstr "寫入器物件有下列公用屬性:"
669711

670712
#: ../../library/csv.rst:519
671713
msgid "A read-only description of the dialect in use by the writer."
672-
msgstr ""
714+
msgstr "dialect 的唯讀敘述,會被寫入器使用。"
673715

674716
#: ../../library/csv.rst:522
675717
msgid "DictWriter objects have the following public method:"
676-
msgstr ""
718+
msgstr "DictWriter 物件有下列公用方法:"
677719

678720
#: ../../library/csv.rst:527
679721
msgid ""
680722
"Write a row with the field names (as specified in the constructor) to the "
681723
"writer's file object, formatted according to the current dialect. Return the "
682724
"return value of the :meth:`csvwriter.writerow` call used internally."
683725
msgstr ""
726+
"將具欄位標題的一列(於建構函式 (constructor) 中指定的)寫入至寫入器的檔案物件"
727+
"中,並依照當前的 dialect 進行格式化。回傳內部呼叫 :meth:`csvwriter.writerow` "
728+
"的回傳值。"
684729

685730
#: ../../library/csv.rst:532
686731
msgid ""
687732
":meth:`writeheader` now also returns the value returned by the :meth:"
688733
"`csvwriter.writerow` method it uses internally."
689734
msgstr ""
735+
":meth:`writeheader` 現在也會回傳內部呼叫 :meth:`csvwriter.writerow` 的回傳"
736+
"值。"
690737

691738
#: ../../library/csv.rst:540
692739
msgid "Examples"
693740
msgstr "範例"
694741

695742
#: ../../library/csv.rst:542
696743
msgid "The simplest example of reading a CSV file::"
697-
msgstr ""
744+
msgstr "最簡單的讀取 CSV 檔案範例: ::"
698745

699746
#: ../../library/csv.rst:550
700747
msgid "Reading a file with an alternate format::"
701-
msgstr ""
748+
msgstr "讀取一個其他格式的檔案: ::"
702749

703750
#: ../../library/csv.rst:558
704751
msgid "The corresponding simplest possible writing example is::"
705-
msgstr ""
752+
msgstr "相對最簡單、可行的寫入範例為: ::"
706753

707754
#: ../../library/csv.rst:565
708755
msgid ""
@@ -711,28 +758,33 @@ msgid ""
711758
"`locale.getencoding`). To decode a file using a different encoding, use the "
712759
"``encoding`` argument of open::"
713760
msgstr ""
761+
"當 :func:`open` 被使用於開啟並讀取一個 CSV 檔案,該檔案會預設使用系統預設的編"
762+
"碼格式(請見 :func:`locale.getencoding`),並解碼為 unicode。若要使用不同編碼"
763+
"格式進行檔案解碼,請使用 open 函式的 ``encoding`` 引數: ::"
714764

715765
#: ../../library/csv.rst:576
716766
msgid ""
717767
"The same applies to writing in something other than the system default "
718768
"encoding: specify the encoding argument when opening the output file."
719769
msgstr ""
770+
"同理可以應用到使用不同編碼格式進行寫入:當開啟輸出檔案時,指定 ``encoding`` "
771+
"引數。"
720772

721773
#: ../../library/csv.rst:579
722774
msgid "Registering a new dialect::"
723-
msgstr ""
775+
msgstr "註冊一個新的 dialect : ::"
724776

725777
#: ../../library/csv.rst:586
726778
msgid ""
727779
"A slightly more advanced use of the reader --- catching and reporting "
728780
"errors::"
729-
msgstr ""
781+
msgstr "稍微進階的讀取器用法 -- 擷取及回報錯誤: ::"
730782

731783
#: ../../library/csv.rst:598
732784
msgid ""
733785
"And while the module doesn't directly support parsing strings, it can easily "
734786
"be done::"
735-
msgstr ""
787+
msgstr "而當模組無法直接支援剖析字串時,仍可以輕鬆的解決: ::"
736788

737789
#: ../../library/csv.rst:607
738790
msgid "Footnotes"
@@ -746,6 +798,10 @@ msgid ""
746798
"safe to specify ``newline=''``, since the csv module does its own (:term:"
747799
"`universal <universal newlines>`) newline handling."
748800
msgstr ""
801+
"如果 ``newline=''`` 沒有被指定,則嵌入引號中的換行符號不會被正確直譯,使用 "
802+
"``\\r\\n`` 行尾 (linending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自己 "
803+
"(:term:`統一的 <universal newlines>`) 換行處理方式,因此指定 ``newline=''`` "
804+
"會永遠是安全的。"
749805

750806
#: ../../library/csv.rst:11
751807
msgid "csv"

0 commit comments

Comments
 (0)