I have a QT aplication, and in GUI i usses subclasses e.g.
Code in file1:
class Test(QWidget):
def __init__():
print(self.tr("hi! I'm test"))
...
Code in file2:
class TestChild(Test):
def __init__():
super().__init__()
print(self.tr("hi! I'm another test"))
...
And translations works fine when i call Test
class. But, when i call TestChild
class, i get first print untranslated, and second print translated.
Both of files is in sources in .pro file
How can i get translation from super class?
Actually I find solution in adding a own translation methods to every file, but this is’nt right solution.
Dezmonder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.