1- # SOME DESCRIPTIVE TITLE.
21# Copyright (C) 2001 Python Software Foundation
32# This file is distributed under the same license as the Python package.
43# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
@@ -19,7 +18,7 @@ msgstr ""
1918
2019#: ../../c-api/curses.rst:4
2120msgid "Curses C API"
22- msgstr ""
21+ msgstr "Curses C API "
2322
2423#: ../../c-api/curses.rst:6
2524msgid ""
@@ -29,6 +28,10 @@ msgid ""
2928"usually as part of the module initialisation function, to populate :c:var:"
3029"`PyCurses_API`."
3130msgstr ""
31+ ":mod:`curses` 為擴充模組公開了一個小型的 C 介面。使用者必須包含標頭檔 "
32+ ":file:`py_curses.h`\\ (此檔案不會由 :file:`Python.h` 預設包含),並且必須觸發 "
33+ ":c:func:`import_curses` 以填充 (populate) :c:var:`PyCurses_API`,通常是作為"
34+ "模組初始化函式的一部分。"
3235
3336#: ../../c-api/curses.rst:14
3437msgid ""
@@ -39,7 +42,7 @@ msgstr ""
3942#: ../../c-api/curses.rst:19
4043msgid ""
4144"Import the curses C API. The macro does not need a semi-colon to be called."
42- msgstr ""
45+ msgstr "引入 curses C API。呼叫此巨集不需要寫分號。 "
4346
4447#: ../../c-api/curses.rst:21
4548msgid "On success, populate the :c:var:`PyCurses_API` pointer."
@@ -56,6 +59,8 @@ msgid ""
5659"import_curses(); // semi-colon is optional but recommended\n"
5760"if (PyErr_Occurred()) { /* cleanup */ }"
5861msgstr ""
62+ "import_curses(); // 建議要寫分號但非必要\n"
63+ "if (PyErr_Occurred()) { /* 清理 */ }"
5964
6065#: ../../c-api/curses.rst:34
6166msgid ""
@@ -72,6 +77,8 @@ msgid ""
7277"``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are "
7378"pointers to predicate functions of type ``int (*)(void)``."
7479msgstr ""
80+ "``PyCurses_API[1]``、``PyCurses_API[2]`` 和 ``PyCurses_API[3]`` 是指向 "
81+ "型別為 ``int (*)(void)`` 的謂詞函式 (predicate functions) 的指標。"
7582
7683#: ../../c-api/curses.rst:42
7784msgid ""
@@ -107,7 +114,7 @@ msgstr ""
107114#: ../../c-api/curses.rst:69
108115msgid ""
109116"Return true if *op* is a :class:`curses.window` instance, false otherwise."
110- msgstr ""
117+ msgstr "如果 *op* 是 :class:`curses.window` 實例則回傳 true,否則回傳 false。 "
111118
112119#: ../../c-api/curses.rst:72
113120msgid ""
@@ -118,12 +125,12 @@ msgstr ""
118125
119126#: ../../c-api/curses.rst:78
120127msgid "Macro checking if :func:`curses.setupterm` has been called."
121- msgstr ""
128+ msgstr "如果已呼叫 :func:`curses.setupterm`,則為巨集檢查。 "
122129
123130#: ../../c-api/curses.rst:80 ../../c-api/curses.rst:97
124131#: ../../c-api/curses.rst:114
125132msgid "The macro expansion is roughly equivalent to:"
126- msgstr ""
133+ msgstr "巨集展開大致相當於: "
127134
128135#: ../../c-api/curses.rst:82
129136msgid ""
@@ -135,10 +142,17 @@ msgid ""
135142" }\n"
136143"}"
137144msgstr ""
145+ "{\n"
146+ " typedef int (*predicate_t)(void);\n"
147+ " predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n"
148+ " if (!was_setupterm_called()) {\n"
149+ " return NULL;\n"
150+ " }\n"
151+ "}"
138152
139153#: ../../c-api/curses.rst:95
140154msgid "Macro checking if :func:`curses.initscr` has been called."
141- msgstr ""
155+ msgstr "如果已呼叫 :func:`curses.initscr`,則為巨集檢查。 "
142156
143157#: ../../c-api/curses.rst:99
144158msgid ""
@@ -150,10 +164,17 @@ msgid ""
150164" }\n"
151165"}"
152166msgstr ""
167+ "{\n"
168+ " typedef int (*predicate_t)(void);\n"
169+ " predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n"
170+ " if (!was_initscr_called()) {\n"
171+ " return NULL;\n"
172+ " }\n"
173+ "}"
153174
154175#: ../../c-api/curses.rst:112
155176msgid "Macro checking if :func:`curses.start_color` has been called."
156- msgstr ""
177+ msgstr "如果已呼叫 :func:`curses.start_color`,則為巨集檢查。 "
157178
158179#: ../../c-api/curses.rst:116
159180msgid ""
@@ -165,21 +186,28 @@ msgid ""
165186" }\n"
166187"}"
167188msgstr ""
189+ "{\n"
190+ " typedef int (*predicate_t)(void);\n"
191+ " predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n"
192+ " if (!was_start_color_called()) {\n"
193+ " return NULL;\n"
194+ " }\n"
195+ "}"
168196
169197#: ../../c-api/curses.rst:128
170198msgid "Internal data"
171- msgstr ""
199+ msgstr "內部資料 "
172200
173201#: ../../c-api/curses.rst:130
174202msgid ""
175203"The following objects are exposed by the C API but should be considered "
176204"internal-only."
177- msgstr ""
205+ msgstr "以下物件由 C API 所公開,但應視為僅供內部使用。 "
178206
179207#: ../../c-api/curses.rst:135
180208msgid "Name of the curses capsule to pass to :c:func:`PyCapsule_Import`."
181209msgstr ""
182210
183211#: ../../c-api/curses.rst:137
184212msgid "Internal usage only. Use :c:macro:`import_curses` instead."
185- msgstr ""
213+ msgstr "僅供內部使用。請改用 :c:macro:`import_curses`。 "
0 commit comments