diff --git a/library/linecache.po b/library/linecache.po index 167947f2539..cdb7ae4122d 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -3,13 +3,14 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Weilin Du, 2025 msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-01 22:24+0800\n" -"PO-Revision-Date: 2018-05-23 16:05+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2025-07-07 23:50+0800\n" +"Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,6 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.6\n" #: ../../library/linecache.rst:2 msgid ":mod:`!linecache` --- Random access to text lines" @@ -30,10 +32,14 @@ msgstr "**原始碼:**\\ :source:`Lib/linecache.py`" msgid "" "The :mod:`linecache` module allows one to get any line from a Python source " "file, while attempting to optimize internally, using a cache, the common " -"case where many lines are read from a single file. This is used by the :mod:" -"`traceback` module to retrieve source lines for inclusion in the formatted " -"traceback." +"case where many lines are read from a single file. This is used by " +"the :mod:`traceback` module to retrieve source lines for inclusion in the " +"formatted traceback." msgstr "" +":mod:`linecache` 模組允許從 Python 原始碼檔案中取得任何一行。當嘗試在程式內部" +"進行最佳化,會使用快取,這是從單一檔案讀取許多行的常見情況。 這" +"被 :mod:`traceback` 模組用來擷取來自原始碼檔案的行,以包含在格式化的 " +"traceback 中。" #: ../../library/linecache.rst:18 msgid "" @@ -41,10 +47,13 @@ msgid "" "uses :func:`tokenize.detect_encoding` to get the encoding of the file; in " "the absence of an encoding token, the file encoding defaults to UTF-8." msgstr "" +":func:`tokenize.open` 函式用來開啟檔案。這個函式使" +"用 :func:`tokenize.detect_encoding` 來取得檔案的編碼;在沒有編碼標記的情況" +"下,檔案編碼預設為 UTF-8。" #: ../../library/linecache.rst:22 msgid "The :mod:`linecache` module defines the following functions:" -msgstr "" +msgstr ":mod:`linecache` 模組定義了下列函式:" #: ../../library/linecache.rst:27 msgid "" @@ -52,22 +61,31 @@ msgid "" "an exception --- it will return ``''`` on errors (the terminating newline " "character will be included for lines that are found)." msgstr "" +"從名為 *filename* 的檔案中取得 *lineno* 行。這個函式不會產生例外 --- 它會在出" +"錯時回傳 ``''`` (找到的行會包含終止換行字元)。" #: ../../library/linecache.rst:33 msgid "" -"If a file named *filename* is not found, the function first checks for a :" -"pep:`302` ``__loader__`` in *module_globals*. If there is such a loader and " -"it defines a ``get_source`` method, then that determines the source lines " -"(if ``get_source()`` returns ``None``, then ``''`` is returned). Finally, if " -"*filename* is a relative filename, it is looked up relative to the entries " -"in the module search path, ``sys.path``." +"If a file named *filename* is not found, the function first checks for " +"a :pep:`302` ``__loader__`` in *module_globals*. If there is such a loader " +"and it defines a ``get_source`` method, then that determines the source " +"lines (if ``get_source()`` returns ``None``, then ``''`` is returned). " +"Finally, if *filename* is a relative filename, it is looked up relative to " +"the entries in the module search path, ``sys.path``." msgstr "" +"如果找不到名為 *filename* 的檔案,函式會先檢查 *module_globals* 中是否" +"有 :pep:`302` `__loader__` 載入器。如果有這樣一個載入器,而且它定義了一個 " +"``get_source`` 方法,這之後它就會決定原始碼行(如果 ``get_source()`` 回傳 " +"``None``,那麼就會回傳 ``''``)。最後,如果 *filename* 是相對的檔案名稱,則會" +"相對於模組搜尋路徑 ``sys.path`` 中的項目進行搜尋。" #: ../../library/linecache.rst:44 msgid "" "Clear the cache. Use this function if you no longer need lines from files " "previously read using :func:`getline`." msgstr "" +"清除快取。如果你不再需要先前使用 :func:`getline` 讀取的檔案行數,請使用此函" +"式。" #: ../../library/linecache.rst:50 msgid "" @@ -75,6 +93,8 @@ msgid "" "have changed on disk, and you require the updated version. If *filename* is " "omitted, it will check all the entries in the cache." msgstr "" +"檢查快取是否有效。如果快取中的檔案可能已在磁碟上變更,而你需要更新的版本,請" +"使用此功能。 如果省略 *filename*,則會檢查快取中的所有項目。" #: ../../library/linecache.rst:56 msgid "" @@ -83,6 +103,9 @@ msgid "" "later call. This avoids doing I/O until a line is actually needed, without " "having to carry the module globals around indefinitely." msgstr "" +"即使 *module_globals* 在稍後的呼叫中是 ``None`` ,也可以擷取非檔案型模組的足" +"夠細節,以允許稍後透過 :func:`getline` 取得其行。這可以避免在真正需要某一行之" +"前進行 I/O 操作,而不必無限期地帶著模組的全域變數。" #: ../../library/linecache.rst:63 msgid "Example::"