Skip to content

Commit 6218509

Browse files
feat(translate): wsgiref.po (#612)
* docs(wsgiref): add partial document translation from english to traditional chinese * docs(wsgiref): modified partial document translation content from rst:2 to rst:118 * docs(wsgiref): fixed formatting issue at rst:112 * Update library/wsgiref.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
1 parent 84a0fc5 commit 6218509

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

library/wsgiref.po

+41-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ msgstr ""
2020

2121
#: ../../library/wsgiref.rst:2
2222
msgid ":mod:`wsgiref` --- WSGI Utilities and Reference Implementation"
23-
msgstr ""
23+
msgstr ":mod:`wsgiref` --- WSGI 工具與參考實作"
2424

2525
#: ../../library/wsgiref.rst:10
2626
msgid "**Source code:** :source:`Lib/wsgiref`"
@@ -33,6 +33,8 @@ msgid ""
3333
"interface makes it easy to use an application that supports WSGI with a "
3434
"number of different web servers."
3535
msgstr ""
36+
"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁"
37+
"有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。"
3638

3739
#: ../../library/wsgiref.rst:19
3840
msgid ""
@@ -41,6 +43,8 @@ msgid ""
4143
"every detail of WSGI just to install a WSGI application or to write a web "
4244
"application using an existing framework."
4345
msgstr ""
46+
"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程"
47+
"式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。"
4448

4549
#: ../../library/wsgiref.rst:24
4650
msgid ""
@@ -52,16 +56,21 @@ msgid ""
5256
"that checks WSGI servers and applications for conformance to the WSGI "
5357
"specification (:pep:`3333`)."
5458
msgstr ""
59+
":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI "
60+
"環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程"
61+
"式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。"
5562

5663
#: ../../library/wsgiref.rst:32
5764
msgid ""
5865
"See `wsgi.readthedocs.io <https://wsgi.readthedocs.io/>`_ for more "
5966
"information about WSGI, and links to tutorials and other resources."
6067
msgstr ""
68+
"參閱 `wsgi.readthedocs.io <https://wsgi.readthedocs.io/>` 更多 WSGI 相關資訊,以及教學連結"
69+
"與其他資源。"
6170

6271
#: ../../library/wsgiref.rst:39
6372
msgid ":mod:`wsgiref.util` -- WSGI environment utilities"
64-
msgstr ""
73+
msgstr ":mod:`wsgiref.util` -- WSGI 環境工具"
6574

6675
#: ../../library/wsgiref.rst:45
6776
msgid ""
@@ -72,13 +81,18 @@ msgid ""
7281
"please see :pep:`3333` for a detailed specification and :data:`~wsgiref."
7382
"types.WSGIEnvironment` for a type alias that can be used in type annotations."
7483
msgstr ""
84+
"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。"
85+
"所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:"
86+
"`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。
7587
7688
#: ../../library/wsgiref.rst:56
7789
msgid ""
7890
"Return a guess for whether ``wsgi.url_scheme`` should be \"http\" or "
7991
"\"https\", by checking for a ``HTTPS`` environment variable in the *environ* "
8092
"dictionary. The return value is a string."
8193
msgstr ""
94+
"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \"http\"\"https\""
95+
" 的猜測。回傳值為一個字串。"
8296

8397
#: ../../library/wsgiref.rst:60
8498
msgid ""
@@ -88,6 +102,9 @@ msgid ""
88102
"a request is received via SSL. So, this function returns \"https\" if such "
89103
"a value is found, and \"http\" otherwise."
90104
msgstr ""
105+
"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的"
106+
"伺服器在通過 SSL 接收到請求時會包含 \"1\"\"yes\",或 \"on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函"
107+
"式回傳 \"https\",否則回傳 \"http\"
91108
92109
#: ../../library/wsgiref.rst:69
93110
msgid ""
@@ -96,26 +113,33 @@ msgid ""
96113
"If *include_query* is false, the query string is not included in the "
97114
"resulting URI."
98115
msgstr ""
116+
"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串,"
117+
"如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。"
99118

100119
#: ../../library/wsgiref.rst:76
101120
msgid ""
102121
"Similar to :func:`request_uri`, except that the ``PATH_INFO`` and "
103122
"``QUERY_STRING`` variables are ignored. The result is the base URI of the "
104123
"application object addressed by the request."
105124
msgstr ""
125+
"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的"
126+
"的基本 URI。"
106127

107128
#: ../../library/wsgiref.rst:83
108129
msgid ""
109130
"Shift a single name from ``PATH_INFO`` to ``SCRIPT_NAME`` and return the "
110131
"name. The *environ* dictionary is *modified* in-place; use a copy if you "
111132
"need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact."
112133
msgstr ""
134+
"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如"
135+
"果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。"
113136

114137
#: ../../library/wsgiref.rst:87
115138
msgid ""
116139
"If there are no remaining path segments in ``PATH_INFO``, ``None`` is "
117140
"returned."
118141
msgstr ""
142+
"如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。"
119143

120144
#: ../../library/wsgiref.rst:89
121145
msgid ""
@@ -130,6 +154,11 @@ msgid ""
130154
"bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, "
131155
"and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``."
132156
msgstr ""
157+
"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程式會修改傳入的環境,使其適用於調用位於"
158+
"目標 URI 的 WSGI 應用程式。例如,如果在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,"
159+
"並且位於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 \"bar\",而環境將被更新為適用"
160+
"於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``,"
161+
"而 ``PATH_INFO`` 將從 ``/bar/baz`` 變更為 ``/baz``。"
133162

134163
#: ../../library/wsgiref.rst:100
135164
msgid ""
@@ -140,10 +169,13 @@ msgid ""
140169
"difference between URIs ending in ``/x`` from ones ending in ``/x/`` when "
141170
"using this routine to do object traversal."
142171
msgstr ""
172+
"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片"
173+
"段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可"
174+
"以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。"
143175

144176
#: ../../library/wsgiref.rst:110
145177
msgid "Update *environ* with trivial defaults for testing purposes."
146-
msgstr ""
178+
msgstr "為測試目的,以簡單的預設值更新 *environ* 。"
147179

148180
#: ../../library/wsgiref.rst:112
149181
msgid ""
@@ -153,13 +185,19 @@ msgid ""
153185
"*`` variables. It only supplies default values, and does not replace any "
154186
"existing settings for these variables."
155187
msgstr ""
188+
"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``"
189+
"、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代"
190+
"現有的這些變數設定。"
156191

157192
#: ../../library/wsgiref.rst:118
158193
msgid ""
159194
"This routine is intended to make it easier for unit tests of WSGI servers "
160195
"and applications to set up dummy environments. It should NOT be used by "
161196
"actual WSGI servers or applications, since the data is fake!"
162197
msgstr ""
198+
"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為"
199+
"所產生的數據是假的!"
200+
163201

164202
#: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170
165203
#: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425

0 commit comments

Comments
 (0)