Skip to content

Commit ebeb4b6

Browse files
committed
pyqt 国际化
1 parent 26fa0df commit ebeb4b6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Chapter03/qt03_i18n01.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def __init__(self,parent=None):
2121
self.setLayout(vlayout)
2222

2323
if __name__ == "__main__":
24-
app = QApplication(sys.argv)
25-
form = Winform()
26-
form.show()
27-
sys.exit(app.exec_())
24+
app = QApplication(sys.argv)
25+
form = Winform()
26+
form.show()
27+
sys.exit(app.exec_())
2828

Chapter03/qt03_i18n02.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ def __init__(self,parent=None):
2222
self.setLayout(vlayout)
2323

2424
if __name__ == "__main__":
25-
app = QApplication(sys.argv)
26-
trans = QTranslator()
27-
# 没有后缀.qm
28-
trans.load("zh_CN")
29-
app.installTranslator(trans)
30-
form = Winform()
31-
form.show()
32-
sys.exit(app.exec_())
25+
app = QApplication(sys.argv)
26+
trans = QTranslator()
27+
# 没有后缀.qm
28+
trans.load("zh_CN")
29+
app.installTranslator(trans)
30+
form = Winform()
31+
form.show()
32+
sys.exit(app.exec_())
3333

0 commit comments

Comments
 (0)