@@ -8,7 +8,7 @@ msgstr ""
88"Project-Id-Version : Python 3.13\n "
99"Report-Msgid-Bugs-To : \n "
1010"POT-Creation-Date : 2024-09-01 22:24+0800\n "
11- "PO-Revision-Date : 2018-05-23 16:05+0000 \n "
11+ "PO-Revision-Date : 2025-07-07 23:41+0800 \n "
1212"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
1313"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
1414"tw)\n "
@@ -17,6 +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.6\n "
2021
2122#: ../../library/linecache.rst:2
2223msgid ":mod:`!linecache` --- Random access to text lines"
@@ -30,51 +31,69 @@ msgstr "**原始碼:**\\ :source:`Lib/linecache.py`"
3031msgid ""
3132"The :mod:`linecache` module allows one to get any line from a Python source "
3233"file, while attempting to optimize internally, using a cache, the common "
33- "case where many lines are read from a single file. This is used by the :mod: "
34- "`traceback` module to retrieve source lines for inclusion in the formatted "
35- "traceback."
34+ "case where many lines are read from a single file. This is used by "
35+ "the :mod: `traceback` module to retrieve source lines for inclusion in the "
36+ "formatted traceback."
3637msgstr ""
38+ ":mod:`linecache` 模組允許從 Python 原始碼檔案中取得任何一行。儅嘗試在程式内部"
39+ "進行優化,會使用緩存,這是從單一檔案讀取許多行的常見情況。 這"
40+ "被 :mod:`traceback` 模組用來擷取來自原始碼檔案的行,以包含在格式化的 "
41+ "traceback 中。"
3742
3843#: ../../library/linecache.rst:18
3944msgid ""
4045"The :func:`tokenize.open` function is used to open files. This function "
4146"uses :func:`tokenize.detect_encoding` to get the encoding of the file; in "
4247"the absence of an encoding token, the file encoding defaults to UTF-8."
4348msgstr ""
49+ ":func:`tokenize.open` 函式用來開啟檔案。這個函式使"
50+ "用 :func:`tokenize.detect_encoding` 來取得檔案的編碼;在沒有編碼標記的情況"
51+ "下,檔案編碼預設為 UTF-8。"
4452
4553#: ../../library/linecache.rst:22
4654msgid "The :mod:`linecache` module defines the following functions:"
47- msgstr ""
55+ msgstr ":mod:`linecache` 模組定義了下列函式: "
4856
4957#: ../../library/linecache.rst:27
5058msgid ""
5159"Get line *lineno* from file named *filename*. This function will never raise "
5260"an exception --- it will return ``''`` on errors (the terminating newline "
5361"character will be included for lines that are found)."
5462msgstr ""
63+ "從名為 *filename* 的檔案中取得 *lineno* 行。這個函式不會產生異常 --- 它會在出"
64+ "錯時返回 ``''``(找到的行會包含終止換行符號)。"
5565
5666#: ../../library/linecache.rst:33
5767msgid ""
58- "If a file named *filename* is not found, the function first checks for a : "
59- "pep:`302` ``__loader__`` in *module_globals*. If there is such a loader and "
60- "it defines a ``get_source`` method, then that determines the source lines "
61- "(if ``get_source()`` returns ``None``, then ``''`` is returned). Finally, if "
62- "*filename* is a relative filename, it is looked up relative to the entries "
63- "in the module search path, ``sys.path``."
68+ "If a file named *filename* is not found, the function first checks for "
69+ "a : pep:`302` ``__loader__`` in *module_globals*. If there is such a loader "
70+ "and it defines a ``get_source`` method, then that determines the source "
71+ "lines (if ``get_source()`` returns ``None``, then ``''`` is returned). "
72+ "Finally, if *filename* is a relative filename, it is looked up relative to "
73+ "the entries in the module search path, ``sys.path``."
6474msgstr ""
75+ "如果找不到名為 *filename* 的檔案,函式會先檢查 *module_globals* 中是否"
76+ "有 :pep:`302``__loader__` 裝載器。如果有這樣一個載入器,而且它定義了一個 "
77+ "``get_source`` 方法,這之後它就會決定原始碼行 (如果 ``get_source()`` 返回 "
78+ "``None``,那麼就會返回 ``''``)。最後,如果 *filename* 是相對的檔案名稱,則會"
79+ "相對於模組搜尋路徑 ``sys.path`` 中的項目進行搜尋。"
6580
6681#: ../../library/linecache.rst:44
6782msgid ""
6883"Clear the cache. Use this function if you no longer need lines from files "
6984"previously read using :func:`getline`."
7085msgstr ""
86+ "清除緩存。 如果您不再需要先前使用 :func:`getline` 讀取的檔案行數,請使用此函"
87+ "式。"
7188
7289#: ../../library/linecache.rst:50
7390msgid ""
7491"Check the cache for validity. Use this function if files in the cache may "
7592"have changed on disk, and you require the updated version. If *filename* is "
7693"omitted, it will check all the entries in the cache."
7794msgstr ""
95+ "檢查緩存是否有效。 如果緩存中的檔案可能已在磁碟上變更,而您需要更新的版本,請"
96+ "使用此功能。 如果省略 *filename*,則會檢查緩存中的所有項目。"
7897
7998#: ../../library/linecache.rst:56
8099msgid ""
@@ -83,6 +102,9 @@ msgid ""
83102"later call. This avoids doing I/O until a line is actually needed, without "
84103"having to carry the module globals around indefinitely."
85104msgstr ""
105+ "即使 *module_globals* 在稍後的呼叫中是 ``None`` ,也可以擷取非檔案型模組的足"
106+ "夠細節,以允許稍後透過 :func:`getline` 取得其行。這可以避免在真正需要某一行之"
107+ "前進行 I/O 操作,而不必無限期地帶著模塊的全局變量。"
86108
87109#: ../../library/linecache.rst:63
88110msgid "Example::"
0 commit comments