import sys
from PyQt5 import QtCore, QtGui, QtWidgets


class Demo(QtWidgets.QWidget):
    def __init__(self):
        super(Demo, self).__init__()
        self.button = QtWidgets.QPushButton()
        self.label = QtWidgets.QLabel(alignment=QtCore.Qt.AlignCenter)

        self.combo = QtWidgets.QComboBox(self)
        self.combo.currentIndexChanged.connect(self.change_func)

        self.trans = QtCore.QTranslator(self)

        self.v_layout = QtWidgets.QVBoxLayout(self)
        self.v_layout.addWidget(self.combo)
        self.v_layout.addWidget(self.button)
        self.v_layout.addWidget(self.label)

        options = ([('English', ''), ('français', 'eng-fr' ), ('中文', 'eng-chs'), ])
        
        for i, (text, lang) in enumerate(options):
        	self.combo.addItem(text)
        	self.combo.setItemData(i, lang)
        self.retranslateUi()

    @QtCore.pyqtSlot(int)
    def change_func(self, index):
        data = self.combo.itemData(index)
        if data:
            self.trans.load(data)
            QtWidgets.QApplication.instance().installTranslator(self.trans)
        else:
            QtWidgets.QApplication.instance().removeTranslator(self.trans)

    def changeEvent(self, event):
        if event.type() == QtCore.QEvent.LanguageChange:
            self.retranslateUi()
        super(Demo, self).changeEvent(event)

    def retranslateUi(self):
        self.button.setText(QtWidgets.QApplication.translate('Demo', 'Start'))
        self.label.setText(QtWidgets.QApplication.translate('Demo', 'Hello, World'))


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    demo = Demo()
    demo.show()
    sys.exit(app.exec_())
[((28, 5, 28, 25), 'PyQt5.QtCore.pyqtSlot', 'QtCore.pyqtSlot', ({(28, 21, 28, 24): 'int'}, {}), '(int)', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((48, 10, 48, 42), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', ({(48, 33, 48, 41): 'sys.argv'}, {}), '(sys.argv)', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((8, 22, 8, 45), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', ({}, {}), '()', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((9, 21, 9, 70), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (), '', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((11, 21, 11, 46), 'PyQt5.QtWidgets.QComboBox', 'QtWidgets.QComboBox', ({(11, 41, 11, 45): 'self'}, {}), '(self)', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((14, 21, 14, 45), 'PyQt5.QtCore.QTranslator', 'QtCore.QTranslator', ({(14, 40, 14, 44): 'self'}, {}), '(self)', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((16, 24, 16, 51), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', ({(16, 46, 16, 50): 'self'}, {}), '(self)', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((43, 28, 43, 77), 'PyQt5.QtWidgets.QApplication.translate', 'QtWidgets.QApplication.translate', ({(43, 61, 43, 67): '"""Demo"""', (43, 69, 43, 76): '"""Start"""'}, {}), "('Demo', 'Start')", False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((44, 27, 44, 83), 'PyQt5.QtWidgets.QApplication.translate', 'QtWidgets.QApplication.translate', ({(44, 60, 44, 66): '"""Demo"""', (44, 68, 44, 82): '"""Hello, World"""'}, {}), "('Demo', 'Hello, World')", False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((33, 12, 33, 45), 'PyQt5.QtWidgets.QApplication.instance', 'QtWidgets.QApplication.instance', ({}, {}), '()', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((35, 12, 35, 45), 'PyQt5.QtWidgets.QApplication.instance', 'QtWidgets.QApplication.instance', ({}, {}), '()', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n')]