Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.6.1
-
None
-
Python 3.12
Description
Pyside6-lupdate does not pick up python unicode strings.
This is problematic because pyside6-uic generates unicode strings from .ui files.
As a result, none of the uic-generated code is translatable without additional editing.
Minimal example .ui:
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Foo</class> <widget class="QWidget" name="Foo"> <property name="windowTitle"> <string>FooTitle</string> </property> </widget> <resources/> <connections/> </ui>
Compilation with pyside6-uic creates a python file including the following translation function:
def retranslateUi(self, Foo): Foo.setWindowTitle(QCoreApplication.translate("Foo", u"FooTitle", None))
Running this file through pyside6-lupdate results in an empty .ts file.
After changing u"FooTitle" into a standard python string "FooTitle", lupdate recognizes the string and generates a valid translation file:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1"> <context> <name>Foo</name> <message> <location filename="ui_untitled.py" line="31"/> <source>FooTitle</source> <translation type="unfinished"></translation> </message> </context> </TS>
Attachments
Issue Links
- relates to
-
PYSIDE-2380 pyside6-lupdate ignores r-strings
- Closed