-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUi_translate.py
executable file
·263 lines (256 loc) · 14.7 KB
/
Ui_translate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\python\translate-beta\translate.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setEnabled(True)
MainWindow.resize(900, 500)
MainWindow.setMinimumSize(QtCore.QSize(900, 500))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/newPrefix/resources/translate.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout_2.setObjectName("gridLayout_2")
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox.setObjectName("groupBox")
self.gridLayout = QtWidgets.QGridLayout(self.groupBox)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.radio_en = QtWidgets.QRadioButton(self.groupBox)
self.radio_en.setChecked(True)
self.radio_en.setObjectName("radio_en")
self.horizontalLayout_3.addWidget(self.radio_en)
self.radio_ja = QtWidgets.QRadioButton(self.groupBox)
self.radio_ja.setObjectName("radio_ja")
self.horizontalLayout_3.addWidget(self.radio_ja)
self.radio_ko = QtWidgets.QRadioButton(self.groupBox)
self.radio_ko.setChecked(False)
self.radio_ko.setObjectName("radio_ko")
self.horizontalLayout_3.addWidget(self.radio_ko)
self.radio_ru = QtWidgets.QRadioButton(self.groupBox)
self.radio_ru.setObjectName("radio_ru")
self.horizontalLayout_3.addWidget(self.radio_ru)
self.radio_de = QtWidgets.QRadioButton(self.groupBox)
self.radio_de.setObjectName("radio_de")
self.horizontalLayout_3.addWidget(self.radio_de)
self.radio_fr = QtWidgets.QRadioButton(self.groupBox)
self.radio_fr.setObjectName("radio_fr")
self.horizontalLayout_3.addWidget(self.radio_fr)
self.radio_es = QtWidgets.QRadioButton(self.groupBox)
self.radio_es.setObjectName("radio_es")
self.horizontalLayout_3.addWidget(self.radio_es)
self.radio_pt = QtWidgets.QRadioButton(self.groupBox)
self.radio_pt.setObjectName("radio_pt")
self.horizontalLayout_3.addWidget(self.radio_pt)
self.radio_it = QtWidgets.QRadioButton(self.groupBox)
self.radio_it.setObjectName("radio_it")
self.horizontalLayout_3.addWidget(self.radio_it)
self.radio_ar = QtWidgets.QRadioButton(self.groupBox)
self.radio_ar.setObjectName("radio_ar")
self.horizontalLayout_3.addWidget(self.radio_ar)
self.radio_id = QtWidgets.QRadioButton(self.groupBox)
self.radio_id.setObjectName("radio_id")
self.horizontalLayout_3.addWidget(self.radio_id)
self.radio_vi = QtWidgets.QRadioButton(self.groupBox)
self.radio_vi.setObjectName("radio_vi")
self.horizontalLayout_3.addWidget(self.radio_vi)
self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
self.gridLayout_2.addWidget(self.groupBox, 0, 0, 1, 2)
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 1, 1, 1, 1)
self.con_in = QtWidgets.QTextEdit(self.centralwidget)
self.con_in.setStyleSheet("color:#000000")
self.con_in.setAcceptRichText(False)
self.con_in.setObjectName("con_in")
self.gridLayout_2.addWidget(self.con_in, 2, 0, 1, 1)
self.con_out = QtWidgets.QPlainTextEdit(self.centralwidget)
self.con_out.setStyleSheet("color:#000000")
self.con_out.setReadOnly(True)
self.con_out.setObjectName("con_out")
self.gridLayout_2.addWidget(self.con_out, 2, 1, 1, 1)
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setMinimumSize(QtCore.QSize(40, 0))
self.label_3.setText("")
self.label_3.setObjectName("label_3")
self.horizontalLayout.addWidget(self.label_3)
self.button_fy = QtWidgets.QPushButton(self.centralwidget)
self.button_fy.setObjectName("button_fy")
self.horizontalLayout.addWidget(self.button_fy)
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setMinimumSize(QtCore.QSize(40, 0))
self.label_4.setText("")
self.label_4.setObjectName("label_4")
self.horizontalLayout.addWidget(self.label_4)
self.horizontalLayout_6.addLayout(self.horizontalLayout)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.con_in_voice = QtWidgets.QPushButton(self.centralwidget)
self.con_in_voice.setEnabled(True)
self.con_in_voice.setMinimumSize(QtCore.QSize(16, 16))
self.con_in_voice.setMaximumSize(QtCore.QSize(32, 32))
self.con_in_voice.setStyleSheet("QPushButton{border:none;}")
self.con_in_voice.setText("")
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/newPrefix/resources/audio1.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.con_in_voice.setIcon(icon3)
self.con_in_voice.setObjectName("con_in_voice")
self.horizontalLayout_2.addWidget(self.con_in_voice)
self.label_9 = QtWidgets.QLabel(self.centralwidget)
self.label_9.setMinimumSize(QtCore.QSize(33, 0))
self.label_9.setMaximumSize(QtCore.QSize(30, 16777215))
self.label_9.setText("")
self.label_9.setObjectName("label_9")
self.horizontalLayout_2.addWidget(self.label_9)
self.con_in_size = QtWidgets.QPushButton(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.con_in_size.sizePolicy().hasHeightForWidth())
self.con_in_size.setSizePolicy(sizePolicy)
self.con_in_size.setMinimumSize(QtCore.QSize(16, 16))
self.con_in_size.setMaximumSize(QtCore.QSize(32, 32))
self.con_in_size.setStyleSheet("QPushButton{border:none;}")
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/newPrefix/resources/font.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.con_in_size.setIcon(icon1)
self.con_in_size.setObjectName("con_in_size")
self.horizontalLayout_2.addWidget(self.con_in_size)
self.con_in_color = QtWidgets.QPushButton(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.con_in_color.sizePolicy().hasHeightForWidth())
self.con_in_color.setSizePolicy(sizePolicy)
self.con_in_color.setMinimumSize(QtCore.QSize(16, 16))
self.con_in_color.setMaximumSize(QtCore.QSize(32, 32))
self.con_in_color.setStyleSheet("QPushButton{border:none;}")
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/newPrefix/resources/color.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.con_in_color.setIcon(icon2)
self.con_in_color.setObjectName("con_in_color")
self.horizontalLayout_2.addWidget(self.con_in_color)
self.horizontalLayout_6.addLayout(self.horizontalLayout_2)
self.label_5 = QtWidgets.QLabel(self.centralwidget)
self.label_5.setMinimumSize(QtCore.QSize(10, 0))
self.label_5.setMaximumSize(QtCore.QSize(10, 16777215))
self.label_5.setText("")
self.label_5.setObjectName("label_5")
self.horizontalLayout_6.addWidget(self.label_5)
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.con_out_color = QtWidgets.QPushButton(self.centralwidget)
self.con_out_color.setMinimumSize(QtCore.QSize(16, 16))
self.con_out_color.setMaximumSize(QtCore.QSize(32, 32))
self.con_out_color.setStyleSheet("QPushButton{border:none;}")
self.con_out_color.setIcon(icon2)
self.con_out_color.setObjectName("con_out_color")
self.horizontalLayout_5.addWidget(self.con_out_color)
self.con_out_size = QtWidgets.QPushButton(self.centralwidget)
self.con_out_size.setMinimumSize(QtCore.QSize(16, 16))
self.con_out_size.setMaximumSize(QtCore.QSize(32, 32))
self.con_out_size.setStyleSheet("QPushButton{border:none;}")
self.con_out_size.setIcon(icon1)
self.con_out_size.setObjectName("con_out_size")
self.horizontalLayout_5.addWidget(self.con_out_size)
self.con_out_voice = QtWidgets.QPushButton(self.centralwidget)
self.con_out_voice.setEnabled(True)
self.con_out_voice.setMinimumSize(QtCore.QSize(16, 16))
self.con_out_voice.setMaximumSize(QtCore.QSize(32, 32))
self.con_out_voice.setStyleSheet("QPushButton{border:none;}")
self.con_out_voice.setText("")
self.con_out_voice.setIcon(icon3)
self.con_out_voice.setObjectName("con_out_voice")
self.horizontalLayout_5.addWidget(self.con_out_voice)
self.label_H = QtWidgets.QLabel(self.centralwidget)
self.label_H.setMinimumSize(QtCore.QSize(33, 0))
self.label_H.setMaximumSize(QtCore.QSize(33, 16777215))
self.label_H.setText("")
self.label_H.setObjectName("label_H")
self.horizontalLayout_5.addWidget(self.label_H)
self.horizontalLayout_6.addLayout(self.horizontalLayout_5)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label_7 = QtWidgets.QLabel(self.centralwidget)
self.label_7.setMinimumSize(QtCore.QSize(40, 0))
self.label_7.setText("")
self.label_7.setObjectName("label_7")
self.horizontalLayout_4.addWidget(self.label_7)
self.button_clear = QtWidgets.QPushButton(self.centralwidget)
self.button_clear.setObjectName("button_clear")
self.horizontalLayout_4.addWidget(self.button_clear)
self.label_8 = QtWidgets.QLabel(self.centralwidget)
self.label_8.setMinimumSize(QtCore.QSize(40, 0))
self.label_8.setText("")
self.label_8.setObjectName("label_8")
self.horizontalLayout_4.addWidget(self.label_8)
self.horizontalLayout_6.addLayout(self.horizontalLayout_4)
self.gridLayout_2.addLayout(self.horizontalLayout_6, 3, 0, 1, 2)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
self.menubar.setObjectName("menubar")
self.menu = QtWidgets.QMenu(self.menubar)
self.menu.setObjectName("menu")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionverson = QtWidgets.QAction(MainWindow)
self.actionverson.setObjectName("actionverson")
self.actionhelp = QtWidgets.QAction(MainWindow)
self.actionhelp.setObjectName("actionhelp")
self.menu.addAction(self.actionverson)
self.menu.addAction(self.actionhelp)
self.menu.addSeparator()
self.menubar.addAction(self.menu.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Translater"))
self.groupBox.setStatusTip(_translate("MainWindow", "选择与中文相对的语种"))
self.groupBox.setTitle(_translate("MainWindow", "译文语种"))
self.radio_en.setText(_translate("MainWindow", "英语"))
self.radio_ja.setText(_translate("MainWindow", "日语"))
self.radio_ko.setText(_translate("MainWindow", "韩语"))
self.radio_ru.setText(_translate("MainWindow", "俄语"))
self.radio_de.setText(_translate("MainWindow", "德语"))
self.radio_fr.setText(_translate("MainWindow", "法语"))
self.radio_es.setText(_translate("MainWindow", "西班牙语"))
self.radio_pt.setText(_translate("MainWindow", "葡萄牙语"))
self.radio_it.setText(_translate("MainWindow", "意大利语"))
self.radio_ar.setText(_translate("MainWindow", "阿拉伯语"))
self.radio_id.setText(_translate("MainWindow", "印尼语"))
self.radio_vi.setText(_translate("MainWindow", "越南语"))
self.label.setText(_translate("MainWindow", "原文:"))
self.label_2.setText(_translate("MainWindow", "译文:"))
self.con_in.setStatusTip(_translate("MainWindow", "在此输入需要翻译的内容,支持单词、句子,段落。"))
self.con_out.setStatusTip(_translate("MainWindow", "在此显示翻译结果"))
self.button_fy.setText(_translate("MainWindow", "翻译"))
self.con_in_size.setStatusTip(_translate("MainWindow", "设置原文文字大小"))
self.con_in_color.setStatusTip(_translate("MainWindow", "设置原文文字颜色"))
self.con_out_color.setStatusTip(_translate("MainWindow", "设置译文文字颜色"))
self.con_out_size.setStatusTip(_translate("MainWindow", "设置译文文字大小"))
self.con_in_voice.setStatusTip(_translate("MainWindow", "播放"))
self.con_out_voice.setStatusTip(_translate("MainWindow", "播放"))
self.button_clear.setText(_translate("MainWindow", "清除"))
self.menu.setTitle(_translate("MainWindow", "关于"))
self.actionverson.setText(_translate("MainWindow", "版本"))
self.actionhelp.setText(_translate("MainWindow", "帮助"))
import main_ico_rc