Skip to content

feat(translate): wsgiref.po #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions library/wsgiref.po
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 <https://wsgi.readthedocs.io/>`_ for more "
"information about WSGI, and links to tutorials and other resources."
msgstr ""
"參閱 `wsgi.readthedocs.io <https://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 ""
Expand All @@ -72,13 +81,18 @@ 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 ""
"Return a guess for whether ``wsgi.url_scheme`` should be \"http\" or "
"\"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 ""
Expand All @@ -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 ""
Expand All @@ -96,26 +113,33 @@ 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 ""
"Similar to :func:`request_uri`, except that the ``PATH_INFO`` and "
"``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 ""
"Shift a single name from ``PATH_INFO`` to ``SCRIPT_NAME`` and return the "
"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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -153,13 +185,19 @@ 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 ""
"This routine is intended to make it easier for unit tests of WSGI servers "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattwang44 想詢問 matt 大,比如說這邊的 routine,不太瞭解主要是指什麼意思

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文在此
image

Update environ... 說明這個 function 的功能為何,而後面兩個段落都以 This routine... 開頭分別補充說明作用細節與目的。這邊以 routine 來代指這個 function,就也暗示其為「慣例」、「例行公事」、「慣用程序」,意即因為測試上時常要更新 environ 而將這些步驟封裝成了這個 function。

Copy link
Contributor Author

@neo-maker-sudo neo-maker-sudo Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

喔喔,大概瞭解,所以意思是因為測試的時候需要更新 environ,而這個動作又時常被調用,所以直接封裝起來,並使用 routine 這個詞來代指 function,我可以這樣理解嗎?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我的理解是這樣沒錯~

Copy link
Contributor Author

@neo-maker-sudo neo-maker-sudo Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感謝大大解惑,有種豁然開朗的感覺 XD

"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
Expand Down