Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1733

pyside2-uic general unicode string, which canot detect by both pyside2-lupdate and pylupdate5

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.2
    • PySide
    • None
    • windows 10, python 3.8.7

    • Windows

      pyside2-uic general unicode string, which canot detect by both pyside2-lupdate and pylupdate5

      1. create 'untitled.ui' by pyside2-designer.exe
      2. pyside2-uic.exe untitled.ui -o ui_untitled.py. The code is unicode string like this:

      MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
      self.pushButton.setText(QCoreApplication.translate("MainWindow", u"hello world. \u4e2d\u6587", None))

            3. pyside2-lupdate -noobsolete ui_untitled.py -ts i18n_pysid2-ludate.ts

                (or pylupdate5 -noobsolete ui_untitled.py -ts i18n_pylupdate5.ts)

            The result of pyside2-lupdate:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS><TS version="1.1">
      </TS>

       

      Maybe i think pyside2-uic.exe should genate UTF-8 Text instead unicode string,like pyuic5.exe: 

      MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
      self.pushButton.setText(_translate("MainWindow", "hello world. 中文"))

       

       

       

        1. i18n_pylupdate5.ts
          0.5 kB
          sun qi
        2. i18n_pysid2-ludate.ts
          0.1 kB
          sun qi
        3. ui_untitled.py
          2 kB
          sun qi
        4. untitled.ui
          1 kB
          sun qi
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            dion_sun sun qi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes