diff --git a/library/wsgiref.po b/library/wsgiref.po index f0af46c1b2..4a32e3dffa 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/wsgiref.rst:2 msgid ":mod:`wsgiref` --- WSGI Utilities and Reference Implementation" -msgstr "" +msgstr ":mod:`wsgiref` --- WSGI 工具與參考實作" #: ../../library/wsgiref.rst:10 msgid "**Source code:** :source:`Lib/wsgiref`" @@ -33,6 +33,8 @@ msgid "" "interface makes it easy to use an application that supports WSGI with a " "number of different web servers." msgstr "" +"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁" +"有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。" #: ../../library/wsgiref.rst:19 msgid "" @@ -41,6 +43,8 @@ msgid "" "every detail of WSGI just to install a WSGI application or to write a web " "application using an existing framework." msgstr "" +"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程" +"式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。" #: ../../library/wsgiref.rst:24 msgid "" @@ -52,16 +56,21 @@ msgid "" "that checks WSGI servers and applications for conformance to the WSGI " "specification (:pep:`3333`)." msgstr "" +":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI " +"環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程" +"式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" #: ../../library/wsgiref.rst:32 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." msgstr "" +"參閱 `wsgi.readthedocs.io ` 更多 WSGI 相關資訊,以及教學連結" +"與其他資源。" #: ../../library/wsgiref.rst:39 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" -msgstr "" +msgstr ":mod:`wsgiref.util` -- WSGI 環境工具" #: ../../library/wsgiref.rst:45 msgid "" @@ -72,6 +81,9 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。" +"所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:" +"`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。 #: ../../library/wsgiref.rst:56 msgid "" @@ -79,6 +91,8 @@ msgid "" "\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " "dictionary. The return value is a string." msgstr "" +"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \"http\" 或 \"https\"" +" 的猜測。回傳值為一個字串。" #: ../../library/wsgiref.rst:60 msgid "" @@ -88,6 +102,9 @@ msgid "" "a request is received via SSL. So, this function returns \"https\" if such " "a value is found, and \"http\" otherwise." msgstr "" +"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的" +"伺服器在通過 SSL 接收到請求時會包含 \"1\",\"yes\",或 \"on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函" +"式回傳 \"https\",否則回傳 \"http\"。 #: ../../library/wsgiref.rst:69 msgid "" @@ -96,6 +113,8 @@ msgid "" "If *include_query* is false, the query string is not included in the " "resulting URI." msgstr "" +"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串," +"如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。" #: ../../library/wsgiref.rst:76 msgid "" @@ -103,6 +122,8 @@ msgid "" "``QUERY_STRING`` variables are ignored. The result is the base URI of the " "application object addressed by the request." msgstr "" +"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的" +"的基本 URI。" #: ../../library/wsgiref.rst:83 msgid "" @@ -110,12 +131,15 @@ msgid "" "name. The *environ* dictionary is *modified* in-place; use a copy if you " "need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact." msgstr "" +"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如" +"果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。" #: ../../library/wsgiref.rst:87 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." msgstr "" +"如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" #: ../../library/wsgiref.rst:89 msgid "" @@ -130,6 +154,11 @@ msgid "" "bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, " "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" +"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程式會修改傳入的環境,使其適用於調用位於" +"目標 URI 的 WSGI 應用程式。例如,如果在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``," +"並且位於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 \"bar\",而環境將被更新為適用" +"於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``," +"而 ``PATH_INFO`` 將從 ``/bar/baz`` 變更為 ``/baz``。" #: ../../library/wsgiref.rst:100 msgid "" @@ -140,10 +169,13 @@ msgid "" "difference between URIs ending in ``/x`` from ones ending in ``/x/`` when " "using this routine to do object traversal." msgstr "" +"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片" +"段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可" +"以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" #: ../../library/wsgiref.rst:110 msgid "Update *environ* with trivial defaults for testing purposes." -msgstr "" +msgstr "為測試目的,以簡單的預設值更新 *environ* 。" #: ../../library/wsgiref.rst:112 msgid "" @@ -153,6 +185,9 @@ msgid "" "*`` variables. It only supplies default values, and does not replace any " "existing settings for these variables." msgstr "" +"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``" +"、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代" +"現有的這些變數設定。" #: ../../library/wsgiref.rst:118 msgid "" @@ -160,6 +195,9 @@ msgid "" "and applications to set up dummy environments. It should NOT be used by " "actual WSGI servers or applications, since the data is fake!" msgstr "" +"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為" +"所產生的數據是假的!" + #: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 #: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425