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