What does retranslateUi do in PyQT

Viewed 2835

When running pyuic5 command and generating a python file from QT designer UI file there is a retranslateUi function.

def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))

Is this function for multi language support and can I safely delete this function if I have no interest in multi language?

I am adding GUI widgets in a loop so this function would be a hassle to implement in my code.

1 Answers

This function is made to implement the multi-language support logic (See 1 and 2).

And you can remove it without problems.

Related