@@ -20,7 +20,7 @@ msgstr ""
20
20
21
21
#: ../../library/wsgiref.rst:2
22
22
msgid ":mod:`wsgiref` --- WSGI Utilities and Reference Implementation"
23
- msgstr ""
23
+ msgstr ":mod:`wsgiref` --- WSGI 工具與參考實作 "
24
24
25
25
#: ../../library/wsgiref.rst:10
26
26
msgid "**Source code:** :source:`Lib/wsgiref`"
@@ -33,6 +33,8 @@ msgid ""
33
33
"interface makes it easy to use an application that supports WSGI with a "
34
34
"number of different web servers."
35
35
msgstr ""
36
+ "網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁"
37
+ "有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。"
36
38
37
39
#: ../../library/wsgiref.rst:19
38
40
msgid ""
@@ -41,6 +43,8 @@ msgid ""
41
43
"every detail of WSGI just to install a WSGI application or to write a web "
42
44
"application using an existing framework."
43
45
msgstr ""
46
+ "只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程"
47
+ "式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。"
44
48
45
49
#: ../../library/wsgiref.rst:24
46
50
msgid ""
@@ -52,16 +56,21 @@ msgid ""
52
56
"that checks WSGI servers and applications for conformance to the WSGI "
53
57
"specification (:pep:`3333`)."
54
58
msgstr ""
59
+ ":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI "
60
+ "環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程"
61
+ "式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。"
55
62
56
63
#: ../../library/wsgiref.rst:32
57
64
msgid ""
58
65
"See `wsgi.readthedocs.io <https://wsgi.readthedocs.io/>`_ for more "
59
66
"information about WSGI, and links to tutorials and other resources."
60
67
msgstr ""
68
+ "參閱 `wsgi.readthedocs.io <https://wsgi.readthedocs.io/>` 更多 WSGI 相關資訊,以及教學連結"
69
+ "與其他資源。"
61
70
62
71
#: ../../library/wsgiref.rst:39
63
72
msgid ":mod:`wsgiref.util` -- WSGI environment utilities"
64
- msgstr ""
73
+ msgstr ":mod:`wsgiref.util` -- WSGI 環境工具 "
65
74
66
75
#: ../../library/wsgiref.rst:45
67
76
msgid ""
@@ -72,13 +81,18 @@ msgid ""
72
81
"please see :pep:`3333` for a detailed specification and :data:`~wsgiref."
73
82
"types.WSGIEnvironment` for a type alias that can be used in type annotations."
74
83
msgstr ""
84
+ "這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。"
85
+ "所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:"
86
+ "`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。
75
87
76
88
#: ../../library/wsgiref.rst:56
77
89
msgid " "
78
90
"Return a guess for whether ``wsgi.url_scheme`` should be \" http\" or "
79
91
"\" https\" , by checking for a ``HTTPS`` environment variable in the *environ* "
80
92
"dictionary. The return value is a string."
81
93
msgstr ""
94
+ "透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \" http\" 或 \" https\" "
95
+ " 的猜測。回傳值為一個字串。"
82
96
83
97
#: ../../library/wsgiref.rst:60
84
98
msgid ""
@@ -88,6 +102,9 @@ msgid ""
88
102
"a request is received via SSL. So, this function returns \" https\" if such "
89
103
"a value is found, and \" http\" otherwise."
90
104
msgstr ""
105
+ "當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的"
106
+ "伺服器在通過 SSL 接收到請求時會包含 \" 1\" ,\" yes\" ,或 \" on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函"
107
+ "式回傳 \" https\" ,否則回傳 \" http\" 。
91
108
92
109
#: ../../library/wsgiref.rst:69
93
110
msgid " "
@@ -96,26 +113,33 @@ msgid ""
96
113
"If *include_query* is false, the query string is not included in the "
97
114
"resulting URI."
98
115
msgstr ""
116
+ "根據 :pep:`3333` 中 \" URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串,"
117
+ "如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。"
99
118
100
119
#: ../../library/wsgiref.rst:76
101
120
msgid ""
102
121
"Similar to :func:`request_uri`, except that the ``PATH_INFO`` and "
103
122
"``QUERY_STRING`` variables are ignored. The result is the base URI of the "
104
123
"application object addressed by the request."
105
124
msgstr ""
125
+ "類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的"
126
+ "的基本 URI。"
106
127
107
128
#: ../../library/wsgiref.rst:83
108
129
msgid ""
109
130
"Shift a single name from ``PATH_INFO`` to ``SCRIPT_NAME`` and return the "
110
131
"name. The *environ* dictionary is *modified* in-place; use a copy if you "
111
132
"need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact."
112
133
msgstr ""
134
+ "將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如"
135
+ "果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。"
113
136
114
137
#: ../../library/wsgiref.rst:87
115
138
msgid ""
116
139
"If there are no remaining path segments in ``PATH_INFO``, ``None`` is "
117
140
"returned."
118
141
msgstr ""
142
+ "如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。"
119
143
120
144
#: ../../library/wsgiref.rst:89
121
145
msgid ""
@@ -130,6 +154,11 @@ msgid ""
130
154
"bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, "
131
155
"and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``."
132
156
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``。"
133
162
134
163
#: ../../library/wsgiref.rst:100
135
164
msgid ""
@@ -140,10 +169,13 @@ msgid ""
140
169
"difference between URIs ending in ``/x`` from ones ending in ``/x/`` when "
141
170
"using this routine to do object traversal."
142
171
msgstr ""
172
+ "當 ``PATH_INFO`` 只是一個 \" /\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片"
173
+ "段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可"
174
+ "以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。"
143
175
144
176
#: ../../library/wsgiref.rst:110
145
177
msgid "Update *environ* with trivial defaults for testing purposes."
146
- msgstr ""
178
+ msgstr "為測試目的,以簡單的預設值更新 *environ* 。 "
147
179
148
180
#: ../../library/wsgiref.rst:112
149
181
msgid ""
@@ -153,13 +185,19 @@ msgid ""
153
185
"*`` variables. It only supplies default values, and does not replace any "
154
186
"existing settings for these variables."
155
187
msgstr ""
188
+ "這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``"
189
+ "、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代"
190
+ "現有的這些變數設定。"
156
191
157
192
#: ../../library/wsgiref.rst:118
158
193
msgid ""
159
194
"This routine is intended to make it easier for unit tests of WSGI servers "
160
195
"and applications to set up dummy environments. It should NOT be used by "
161
196
"actual WSGI servers or applications, since the data is fake!"
162
197
msgstr ""
198
+ "這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為"
199
+ "所產生的數據是假的!"
200
+
163
201
164
202
#: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170
165
203
#: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425
0 commit comments