title: Internationalization (translation) of dialog and the main window in a pyqt5 application
body: <p>I am trying to translate my small application written in pyside2/pyqt5 to several languages, for example, Chinese. After googling, I managed to change the main window to Chinese after select from the menu -> language -> Chinese. However, the pop up dialog from menu -> option still remains English version. It seems the translation info is not transferred to the dialog. How do I solve this?</p>
  
  <p>Basically, I build two ui files in designer and convert to two python files:One mainui.py and one dialogui.py. I then convert the two python file into one *.ts file using</p>
  
  <pre><code>pylupdate5 -verbose mainui.py dialogui.py -ts zh_CN.ts
  </code></pre>
  
  <p>after that, in linguist input the translation words. I can see the items in the dialog, which means this information is not missing. Then I release the file as zh_CN.qm file. All this supporting file I attached below using google drive.</p>
  
  <p><a href="https://drive.google.com/open?id=1uFjuGQ-_SF1y6EqEUNIWHgDP5dkKHC0m" rel="nofollow noreferrer">Supporting files for the question</a></p>
  
  <p>The main file is as </p>
  
  <pre><code>import os
  import sys
  
  from PySide2 import QtCore, QtGui, QtWidgets
  from mainui import Ui_MainWindow
  
  from dialogui import Ui_Dialog
  
  class OptionsDialog(QtWidgets.QDialog,Ui_Dialog):
      def __init__(self,parent):
          super().__init__(parent)
          self.setupUi(self)
          self.retranslateUi(self)
  
  
  class MainWindow(QtWidgets.QMainWindow,Ui_MainWindow):
      def __init__(self):
          super().__init__()
          self.setupUi(self)
          self.actionConfigure.triggered.connect(self.showdialog)
          self.actionChinese.triggered.connect(self.change_lang)
  
      def showdialog(self):
          dlg = OptionsDialog(self)
          dlg.exec_()
  
      def change_lang(self):
          trans = QtCore.QTranslator()
          trans.load('zh_CN')
          QtCore.QCoreApplication.instance().installTranslator(trans)
      self.retranslateUi(self)
  
  
  
  if __name__=='__main__':
      app = QtWidgets.QApplication(sys.argv)
      mainWin = MainWindow()
      mainWin.show()
      ret = app.exec_()
      sys.exit(ret)
  </code></pre>
  
  <p>I think it should be a typical task because almost no application will only have a mainwindow.</p>