PyQt and Pylupdate5
Solved
Qt Creator and other tools
-
Re: Translation using PyQt and Pylupdate5
Hello.
I am trying to create a translation file:pylupdate5.py3 untitled.ui -ts zh_FN.ts
I get an error:
Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/lib64/python3/site-packages/PyQt5/pylupdate_main.py", line 239, in <module> main() File "/usr/lib64/python3/site-packages/PyQt5/pylupdate_main.py", line 228, in main defaultContext, True) UnicodeEncodeError: 'latin-1' codec can't encode characters in position 12-21: ordinal not in range(256)
For the test, I made an empty ui in Designer.
Wrong encoding again.OS Linux
python 3.7.4
python3-module-PyQt5 5.11.3I am new to Python.
Sorry if the question is stupid. -
Hi and welcome to devnet,
Can you show the content of your .ui file ?
-
@SGaist said in PyQt and Pylupdate5:
Can you show the content of your .ui file ?
A practically empty sample.
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>491</width> <height>323</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <widget class="QWidget" name="centralwidget"> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0" colspan="3"> <widget class="QTextEdit" name="textEdit"> <property name="html"> <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hi, I'm Zhenya.</p></body></html></string> </property> </widget> </item> <item row="1" column="0"> <widget class="QPushButton" name="pushButton"> <property name="text"> <string>PushButton</string> </property> </widget> </item> <item row="1" column="1"> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>292</width> <height>20</height> </size> </property> </spacer> </item> <item row="1" column="2"> <widget class="QPushButton" name="pushButton_2"> <property name="text"> <string>PushButton</string> </property> </widget> </item> </layout> </widget> <widget class="QStatusBar" name="statusbar"/> </widget> <resources/> <connections/> </ui>
-
Do you mean the path to the file ?