@@ -19,7 +19,7 @@ msgstr ""
1919
2020#: ../../c-api/curses.rst:4
2121msgid "Curses C API"
22- msgstr ""
22+ msgstr "Curses C API "
2323
2424#: ../../c-api/curses.rst:6
2525msgid ""
@@ -29,6 +29,10 @@ msgid ""
2929"usually as part of the module initialisation function, to populate :c:var:"
3030"`PyCurses_API`."
3131msgstr ""
32+ ":mod:`curses` 為擴充模組公開了一個小型的 C 介面。使用者必須包含標頭檔 "
33+ ":file:`py_curses.h`\\ (此檔案不會由 :file:`Python.h` 預設包含),並且必須觸發 "
34+ ":c:func:`import_curses` 以填充 (populate) :c:var:`PyCurses_API`,通常是作為"
35+ "模組初始化函式的一部分。"
3236
3337#: ../../c-api/curses.rst:14
3438msgid ""
@@ -39,7 +43,7 @@ msgstr ""
3943#: ../../c-api/curses.rst:19
4044msgid ""
4145"Import the curses C API. The macro does not need a semi-colon to be called."
42- msgstr ""
46+ msgstr "引入 curses C API。呼叫此巨集不需要寫分號。 "
4347
4448#: ../../c-api/curses.rst:21
4549msgid "On success, populate the :c:var:`PyCurses_API` pointer."
@@ -56,6 +60,8 @@ msgid ""
5660"import_curses(); // semi-colon is optional but recommended\n"
5761"if (PyErr_Occurred()) { /* cleanup */ }"
5862msgstr ""
63+ "import_curses(); // 建議要寫分號但非必要\n"
64+ "if (PyErr_Occurred()) { /* 清理 */ }"
5965
6066#: ../../c-api/curses.rst:34
6167msgid ""
@@ -72,6 +78,8 @@ msgid ""
7278"``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are "
7379"pointers to predicate functions of type ``int (*)(void)``."
7480msgstr ""
81+ "``PyCurses_API[1]``、``PyCurses_API[2]`` 和 ``PyCurses_API[3]`` 是指向 "
82+ "型別為 ``int (*)(void)`` 的謂詞函式 (predicate functions) 的指標。"
7583
7684#: ../../c-api/curses.rst:42
7785msgid ""
@@ -107,7 +115,7 @@ msgstr ""
107115#: ../../c-api/curses.rst:69
108116msgid ""
109117"Return true if *op* is a :class:`curses.window` instance, false otherwise."
110- msgstr ""
118+ msgstr "如果 *op* 是 :class:`curses.window` 實例則回傳 true,否則回傳 false。 "
111119
112120#: ../../c-api/curses.rst:72
113121msgid ""
@@ -118,12 +126,12 @@ msgstr ""
118126
119127#: ../../c-api/curses.rst:78
120128msgid "Macro checking if :func:`curses.setupterm` has been called."
121- msgstr ""
129+ msgstr "如果已呼叫 :func:`curses.setupterm`,則為巨集檢查。 "
122130
123131#: ../../c-api/curses.rst:80 ../../c-api/curses.rst:97
124132#: ../../c-api/curses.rst:114
125133msgid "The macro expansion is roughly equivalent to:"
126- msgstr ""
134+ msgstr "巨集展開大致相當於: "
127135
128136#: ../../c-api/curses.rst:82
129137msgid ""
@@ -135,10 +143,17 @@ msgid ""
135143" }\n"
136144"}"
137145msgstr ""
146+ "{\n"
147+ " typedef int (*predicate_t)(void);\n"
148+ " predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n"
149+ " if (!was_setupterm_called()) {\n"
150+ " return NULL;\n"
151+ " }\n"
152+ "}"
138153
139154#: ../../c-api/curses.rst:95
140155msgid "Macro checking if :func:`curses.initscr` has been called."
141- msgstr ""
156+ msgstr "如果已呼叫 :func:`curses.initscr`,則為巨集檢查。 "
142157
143158#: ../../c-api/curses.rst:99
144159msgid ""
@@ -150,10 +165,17 @@ msgid ""
150165" }\n"
151166"}"
152167msgstr ""
168+ "{\n"
169+ " typedef int (*predicate_t)(void);\n"
170+ " predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n"
171+ " if (!was_initscr_called()) {\n"
172+ " return NULL;\n"
173+ " }\n"
174+ "}"
153175
154176#: ../../c-api/curses.rst:112
155177msgid "Macro checking if :func:`curses.start_color` has been called."
156- msgstr ""
178+ msgstr "如果已呼叫 :func:`curses.start_color`,則為巨集檢查。 "
157179
158180#: ../../c-api/curses.rst:116
159181msgid ""
@@ -165,21 +187,28 @@ msgid ""
165187" }\n"
166188"}"
167189msgstr ""
190+ "{\n"
191+ " typedef int (*predicate_t)(void);\n"
192+ " predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n"
193+ " if (!was_start_color_called()) {\n"
194+ " return NULL;\n"
195+ " }\n"
196+ "}"
168197
169198#: ../../c-api/curses.rst:128
170199msgid "Internal data"
171- msgstr ""
200+ msgstr "內部資料 "
172201
173202#: ../../c-api/curses.rst:130
174203msgid ""
175204"The following objects are exposed by the C API but should be considered "
176205"internal-only."
177- msgstr ""
206+ msgstr "以下物件由 C API 所公開,但應視為僅供內部使用。 "
178207
179208#: ../../c-api/curses.rst:135
180209msgid "Name of the curses capsule to pass to :c:func:`PyCapsule_Import`."
181210msgstr ""
182211
183212#: ../../c-api/curses.rst:137
184213msgid "Internal usage only. Use :c:macro:`import_curses` instead."
185- msgstr ""
214+ msgstr "僅供內部使用。請改用 :c:macro:`import_curses`。 "