<div dir="ltr"><div>I have a application with international support. This application is a python graphical interface with class derived of QObject, and other without no qt inheritance. The application can use pyqt5 or pyqt6 indistinctly. The problem is pylupdate6 is unable to detect fine the text using the QtWidget.QApplication.translate short name... I post a minimum example</div><div><br></div><div>qt.py</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>#!/usr/bin/python3<br># -*- coding: utf-8 -*-<br><br>try:<br>    from PyQt6 import QtWidgets<br>except ImportError:<br>    from PyQt5 import QtWidgets<br><br># short name used in non QObject instances to apply translation<br>tr = QtWidgets.QApplication.translate<br></div></blockquote><div><br></div><div>translated_library.py</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#!/usr/bin/python3<br># -*- coding: utf-8 -*-<br><br>from qt import QtWidgets, tr<br><br>class TranslatedClass():<br>    title = tr("context", "This is the text to translate, not the comment")<br>    name = QtWidgets.QApplication.translate("context", "This text is detected fine by pylupdate6")<br><br>class QtRelatedClass(QtWidgets.QDialog):<br>    """Its translation are correctly detect by pylupdate6"""<br>    def __init__(self):<br>        super().__init__(self)<br>        <a href="http://self.name">self.name</a> = <a href="http://self.tr">self.tr</a>("correctly translated text")<br></blockquote> </div><div>The example_es.ts is the generated ts file by pylupdate, where the title attribute in non qt class are not fine detected.</div><div><br></div><div>Name attribute is detected fine, but i would use a short alias to avoid write so long QtWidgets.QApplication.translate...</div><div><br></div><div>Thanks for your help<br></div></div>