Details
-
Bug
-
Resolution: Done
-
P4: Low
-
None
-
6.2.0
-
None
-
-
d7606bf73ce8447fa817a7f42e76bf0dc5416a0f (qt/qttools/dev) 5b62f8a44c831e42fb45bfeaf678a7e906e563af (qt/qttools/6.2)
Description
If I use lupdate with native translate function(s) for this sample code:
from PySide6.QtWidgets import QApplication, QMainWindow app = QApplication() win = QMainWindow() win.setWindowTitle(win.tr("Window Title")) win.show() app.exec()
then everything is fine:
$ lupdate main.py -ts it.ts Updating 'it.ts'... Found 1 source text(s) (1 new and 0 already existing) $
But if I change my code and use custom translate function:
from PySide6.QtWidgets import QApplication, QMainWindow def custom_tr(text): return QApplication.translate("Context", text) app = QApplication() win = QMainWindow() win.setWindowTitle(custom_tr("Window Title")) win.show() app.exec()
then it doesn't work:
$ lupdate main.py -ts it.ts -tr-function-alias tr=custom_tr Updating 'it.ts'... Found 0 source text(s) (0 new and 0 already existing) $
It worked before with pylupdate5 and PySide2.