Skip to content

Commit 988e171

Browse files
committed
chore: add file check rules
1 parent c96d8ea commit 988e171

File tree

2 files changed

+101
-33
lines changed

2 files changed

+101
-33
lines changed

Makefile

+21-5
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,34 @@ summarize_progress: $(VENV_FOR_SCRIPT)/bin/activate
8989

9090
.PHONY: google_translate
9191
google_translate: $(VENV_FOR_SCRIPT)/bin/activate
92-
if [ -z $(filter-out $@,$(MAKECMDGOALS)) ]; then \
92+
93+
@$(eval _target=$(filter-out $@, $(MAKECMDGOALS)))
94+
@if [ -z $(_target) ]; then \
9395
echo "Please provide a file argument."; \
9496
exit 1; \
9597
fi
9698

97-
@$(eval __target=$(filter-out $@,$(MAKECMDGOALS)))
98-
@$(eval __filepath=$(addprefix ../,$(__target)))
99-
@$(eval __temp_po_file=tmp.po)
99+
100+
@if [ "$(suffix $(_target))" != ".po" ]; then \
101+
echo "Incorrect file extension. Only '.po' files are allowed."; \
102+
exit 1; \
103+
else \
104+
_target=$(addsuffix ,po,$(_target)); \
105+
fi
106+
107+
@if [ ! -f "$(_target)" ]; then \
108+
echo "File '$(filter-out $@, $(_target))' does not exist."; \
109+
exit 1; \
110+
fi
111+
112+
@$(eval _tmp_po_file=tmp.po)
113+
@$(eval _file_path=$(addprefix ../, $(_target)))
100114

101115
cd .scripts && \
102116
. $(VENV_FOR_SCRIPT)/bin/activate; \
103-
python3 google_translate/main.py $(__filepath) > $(__temp_po_file) ; pomerge -t $(__filepath) -i $(__temp_po_file) -o $(__filepath); rm "$(__temp_po_file)"
117+
python3 google_translate/main.py $(_file_path) > $(_tmp_po_file) ; \
118+
pomerge -t $(_file_path) -i $(_tmp_po_file) -o $(_file_path) ; \
119+
# rm $(_tmp_po_file)
104120
exit 0
105121

106122

library/tkinter.messagebox.po

+80-28
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ msgstr ""
1919
"Content-Transfer-Encoding: 8bit\n"
2020

2121
#: ../../library/tkinter.messagebox.rst:2
22+
#, fuzzy
2223
msgid ":mod:`tkinter.messagebox` --- Tkinter message prompts"
23-
msgstr ""
24+
msgstr ":mod:`tkinter.messagebox` --- Tkinter 訊息提示"
2425

2526
#: ../../library/tkinter.messagebox.rst:8
2627
msgid "**Source code:** :source:`Lib/tkinter/messagebox.py`"
2728
msgstr "**原始碼:**\\ :source:`Lib/tkinter/messagebox.py`"
2829

2930
#: ../../library/tkinter.messagebox.rst:12
31+
#, fuzzy
3032
msgid ""
3133
"The :mod:`tkinter.messagebox` module provides a template base class as well "
3234
"as a variety of convenience methods for commonly used configurations. The "
@@ -35,211 +37,261 @@ msgid ""
3537
"user's selection. Common message box styles and layouts include but are not "
3638
"limited to:"
3739
msgstr ""
40+
"tkinter.messagebox 模組提供了模板基底類別以及各種常用配置的便捷方法。訊息框是"
41+
"模態的,會回傳(``True``, ``False``, ``None``, :data:`OK`, :data:`CANCEL`, "
42+
":data:`YES` 的子集, :data:`NO`) "
43+
"基於使用者的選擇。常見的訊息框樣式和版面配置包括但不限於:"
3844

3945
#: ../../library/tkinter.messagebox.rst:23
46+
#, fuzzy
4047
msgid ""
4148
"Create a message window with an application-specified message, an icon and a "
4249
"set of buttons. Each of the buttons in the message window is identified by a "
4350
"unique symbolic name (see the *type* options)."
4451
msgstr ""
52+
"建立一個訊息\\u200b\\u200b窗口,其中包含應用程式指定的訊息、一個圖示和一組按"
53+
"鈕。訊息視窗中的每個按鈕都由唯一的符號名稱標識(請參閱*type*選項)。"
4554

4655
#: ../../library/tkinter.messagebox.rst:27
56+
#, fuzzy
4757
msgid "The following options are supported:"
48-
msgstr ""
58+
msgstr "支援以下選項:"
4959

5060
#: ../../library/tkinter.messagebox.rst:33
5161
msgid "*command*"
5262
msgstr "*command*"
5363

5464
#: ../../library/tkinter.messagebox.rst:30
65+
#, fuzzy
5566
msgid ""
5667
"Specifies the function to invoke when the user closes the dialog. The name "
5768
"of the button clicked by the user to close the dialog is passed as argument. "
5869
"This is only available on macOS."
59-
msgstr ""
70+
msgstr "指定當使用者關閉對話方塊時要呼叫的函式。使用者按一下以關閉對話框的按鈕的名稱"
71+
"作為參數傳遞。此功能僅適用於 macOS。"
6072

6173
#: ../../library/tkinter.messagebox.rst:39
6274
msgid "*default*"
6375
msgstr "*default*"
6476

6577
#: ../../library/tkinter.messagebox.rst:36
78+
#, fuzzy
6679
msgid ""
6780
"Gives the :ref:`symbolic name <messagebox-buttons>` of the default button "
6881
"for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this "
6982
"option is not specified, the first button in the dialog will be made the "
7083
"default."
7184
msgstr ""
85+
"給出此訊息視窗的預設按鈕的符號名稱 <messagebox-"
86+
"buttons>((:data:`OK`、:data:`CANCEL` "
87+
"等)。如果未指定此選項,則對話方塊中的第一個按鈕將成為預設按鈕。"
7288

7389
#: ../../library/tkinter.messagebox.rst:46
7490
msgid "*detail*"
7591
msgstr "*detail*"
7692

7793
#: ../../library/tkinter.messagebox.rst:42
94+
#, fuzzy
7895
msgid ""
7996
"Specifies an auxiliary message to the main message given by the *message* "
8097
"option. The message detail will be presented beneath the main message and, "
8198
"where supported by the OS, in a less emphasized font than the main message."
8299
msgstr ""
100+
"指定由 *message* 選項給出的主訊息的輔助訊息。訊息詳細資訊將顯示在主要訊息下方"
101+
",並且在作業系統支援的情況下,將以比主要訊息更不強調的字體顯示。"
83102

84103
#: ../../library/tkinter.messagebox.rst:51
85104
msgid "*icon*"
86105
msgstr "*icon*"
87106

88107
#: ../../library/tkinter.messagebox.rst:49
108+
#, fuzzy
89109
msgid ""
90110
"Specifies an :ref:`icon <messagebox-icons>` to display. If this option is "
91111
"not specified, then the :data:`INFO` icon will be displayed."
92-
msgstr ""
112+
msgstr "指定要顯示的圖示 <messagebox-icons>`。如果未指定此選項,則會顯示 INFO 圖示。"
93113

94114
#: ../../library/tkinter.messagebox.rst:55
95115
msgid "*message*"
96116
msgstr "*message*"
97117

98118
#: ../../library/tkinter.messagebox.rst:54
119+
#, fuzzy
99120
msgid ""
100121
"Specifies the message to display in this message box. The default value is "
101122
"an empty string."
102-
msgstr ""
123+
msgstr "指定要在此訊息框中顯示的訊息。預設值為空字串。"
103124

104125
#: ../../library/tkinter.messagebox.rst:59
105126
msgid "*parent*"
106127
msgstr "*parent*"
107128

108129
#: ../../library/tkinter.messagebox.rst:58
130+
#, fuzzy
109131
msgid ""
110132
"Makes the specified window the logical parent of the message box. The "
111133
"message box is displayed on top of its parent window."
112-
msgstr ""
134+
msgstr "使指定視窗成為訊息框的邏輯父視窗。訊息框顯示在其父視窗的頂部。"
113135

114136
#: ../../library/tkinter.messagebox.rst:64
115137
msgid "*title*"
116138
msgstr "*title*"
117139

118140
#: ../../library/tkinter.messagebox.rst:62
141+
#, fuzzy
119142
msgid ""
120143
"Specifies a string to display as the title of the message box. This option "
121144
"is ignored on macOS, where platform guidelines forbid the use of a title on "
122145
"this kind of dialog."
123-
msgstr ""
146+
msgstr "指定顯示為訊息框標題的字串。此選項在 macOS "
147+
"上被忽略,其中平台指南禁止在此類對話方塊上使用標題。"
124148

125149
#: ../../library/tkinter.messagebox.rst:68
126150
msgid "*type*"
127151
msgstr "*type*"
128152

129153
#: ../../library/tkinter.messagebox.rst:67
154+
#, fuzzy
130155
msgid ""
131156
"Arranges for a :ref:`predefined set of buttons <messagebox-types>` to be "
132157
"displayed."
133-
msgstr ""
158+
msgstr "安排顯示一組預先定義的按鈕<messagebox-types>。"
134159

135160
#: ../../library/tkinter.messagebox.rst:72
161+
#, fuzzy
136162
msgid ""
137163
"Display a message window and wait for the user to select one of the buttons. "
138164
"Then return the symbolic name of the selected button. Keyword arguments can "
139165
"override options specified in the constructor."
140-
msgstr ""
166+
msgstr "顯示訊息視窗並等待使用者選擇其中一個按鈕。然後回傳所選按鈕的符號名稱。關鍵字"
167+
"參數可以覆寫建構函式中指定的選項。"
141168

142169
#: ../../library/tkinter.messagebox.rst:76
170+
#, fuzzy
143171
msgid "**Information message box**"
144-
msgstr ""
172+
msgstr "**訊息訊息框**"
145173

146174
#: ../../library/tkinter.messagebox.rst:80
175+
#, fuzzy
147176
msgid ""
148177
"Creates and displays an information message box with the specified title and "
149178
"message."
150-
msgstr ""
179+
msgstr "建立並顯示具有指定標題和訊息的資訊訊息框。"
151180

152181
#: ../../library/tkinter.messagebox.rst:83
182+
#, fuzzy
153183
msgid "**Warning message boxes**"
154-
msgstr ""
184+
msgstr "**警告訊息框**"
155185

156186
#: ../../library/tkinter.messagebox.rst:87
187+
#, fuzzy
157188
msgid ""
158189
"Creates and displays a warning message box with the specified title and "
159190
"message."
160-
msgstr ""
191+
msgstr "建立並顯示具有指定標題和訊息的警告訊息框。"
161192

162193
#: ../../library/tkinter.messagebox.rst:92
194+
#, fuzzy
163195
msgid ""
164196
"Creates and displays an error message box with the specified title and "
165197
"message."
166-
msgstr ""
198+
msgstr "建立並顯示具有指定標題和訊息的錯誤訊息框。"
167199

168200
#: ../../library/tkinter.messagebox.rst:95
201+
#, fuzzy
169202
msgid "**Question message boxes**"
170-
msgstr ""
203+
msgstr "**問題留言框**"
171204

172205
#: ../../library/tkinter.messagebox.rst:99
206+
#, fuzzy
173207
msgid ""
174208
"Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns "
175209
"the symbolic name of the selected button."
176-
msgstr ""
210+
msgstr "問一個問題。預設顯示按鈕:data:`YES` 和:data:`NO`。傳回所選按鈕的符號名稱。"
177211

178212
#: ../../library/tkinter.messagebox.rst:104
213+
#, fuzzy
179214
msgid ""
180215
"Ask if operation should proceed. Shows buttons :data:`OK` and :data:"
181216
"`CANCEL`. Returns ``True`` if the answer is ok and ``False`` otherwise."
182-
msgstr ""
217+
msgstr "詢問操作是否應該繼續。顯示按鈕:data:`OK` "
218+
"和:data:`CANCEL`。如果答案正確則傳回“True”,否則傳回“False”。"
183219

184220
#: ../../library/tkinter.messagebox.rst:109
221+
#, fuzzy
185222
msgid ""
186223
"Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:"
187224
"`CANCEL`. Return ``True`` if the answer is yes and ``False`` otherwise."
188-
msgstr ""
225+
msgstr "詢問是否應重試操作。顯示按鈕 RETRY 和 "
226+
"CANCEL。如果答案是肯定,則傳回“True”,否則傳回“False”。"
189227

190228
#: ../../library/tkinter.messagebox.rst:114
229+
#, fuzzy
191230
msgid ""
192231
"Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` "
193232
"if the answer is yes and ``False`` otherwise."
194-
msgstr ""
233+
msgstr "問一個問題。顯示按鈕:data:`YES` "
234+
"和:data:`NO`。如果答案為是,則傳回“True”,否則傳回“False”。"
195235

196236
#: ../../library/tkinter.messagebox.rst:119
237+
#, fuzzy
197238
msgid ""
198239
"Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. "
199240
"Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` "
200241
"otherwise."
201242
msgstr ""
243+
"問一個問題。顯示按鈕:data:`YES`、:data:`NO` 和:data:`CANCEL`。如果答案是肯定"
244+
"則回傳“True”,如果取消則回傳“None”,否則回傳“False”。"
202245

203246
#: ../../library/tkinter.messagebox.rst:126
247+
#, fuzzy
204248
msgid "Symbolic names of buttons:"
205-
msgstr ""
249+
msgstr "按鈕的符號名稱:"
206250

207251
#: ../../library/tkinter.messagebox.rst:145
252+
#, fuzzy
208253
msgid "Predefined sets of buttons:"
209-
msgstr ""
254+
msgstr "預定義的按鈕組:"
210255

211256
#: ../../library/tkinter.messagebox.rst:150
257+
#, fuzzy
212258
msgid ""
213259
"Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY` "
214260
"and :data:`IGNORE`."
215-
msgstr ""
261+
msgstr "顯示三個按鈕,其符號名稱為:data:`ABORT`、:data:`RETRY` 和:data:`IGNORE`。"
216262

217263
#: ../../library/tkinter.messagebox.rst:157
264+
#, fuzzy
218265
msgid "Displays one button whose symbolic name is :data:`OK`."
219-
msgstr ""
266+
msgstr "顯示一個按鈕,其符號名稱為:data:`OK`。"
220267

221268
#: ../../library/tkinter.messagebox.rst:162
269+
#, fuzzy
222270
msgid ""
223271
"Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`."
224-
msgstr ""
272+
msgstr "顯示兩個按鈕,其符號名稱為:data:`OK` 和:data:`CANCEL`。"
225273

226274
#: ../../library/tkinter.messagebox.rst:168
275+
#, fuzzy
227276
msgid ""
228277
"Displays two buttons whose symbolic names are :data:`RETRY` and :data:"
229278
"`CANCEL`."
230-
msgstr ""
279+
msgstr "顯示兩個按鈕,其符號名稱為 RETRY 和 CANCEL。"
231280

232281
#: ../../library/tkinter.messagebox.rst:174
282+
#, fuzzy
233283
msgid ""
234284
"Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`."
235-
msgstr ""
285+
msgstr "顯示兩個按鈕,其符號名稱為:data:`YES` 和:data:`NO`。"
236286

237287
#: ../../library/tkinter.messagebox.rst:180
288+
#, fuzzy
238289
msgid ""
239290
"Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and :"
240291
"data:`CANCEL`."
241-
msgstr ""
292+
msgstr "顯示三個按鈕,其符號名稱為:data:`YES`、:data:`NO` 和:data:`CANCEL`。"
242293

243294
#: ../../library/tkinter.messagebox.rst:185
295+
#, fuzzy
244296
msgid "Icon images:"
245-
msgstr ""
297+
msgstr "圖標圖像:"

0 commit comments

Comments
 (0)