Hi all,<br><br>I work on simple wizard. I define each type of dialog as *.ui and have the translation problem. <br>How can I translate string defined in *.ui?<br clear="all"><br>For instance, I want to see this:<br><br> <widget class="QLabel" name="label"><br>
<property name="text"><br> <string>Make your choice:</string><br> </property><br> </widget><br><br>as this when using russian locale:<br><br> <widget class="QLabel" name="label"><br>
<property name="text"><br> <string>Сделайте свой выбор:</string><br> </property><br> </widget><br><br><br>Some of sources:<br><span style="font-family: courier new,monospace;">class WizardDialog(QDialog):<br>
<br> def __init__(self, ui_file, parent=None, params=dict()):<br> QDialog.__init__(self, parent)<br><br> dlg = uic.loadUi(ui_file, self)<br> self.setupUi(dlg)<br><br> def prefill(self, title):<br>
self.setWindowTitle(title)<br><br> def setupUi(self, dialog):<br> self.connect(dialog.goBack, SIGNAL('clicked()'), self.go_back)<br> self.connect(dialog.goNext, SIGNAL('clicked()'), self.go_next)<br>
<br> def go_back(self):<br> print 'Back button pressed'<br><br> def go_next(self):<br> print 'Next button pressed'<br><br>class WizardListDlg(WizardDialog):<br><br> def __init__(self, parent=None, params=dict()):<br>
WizardDialog.__init__(self, 'uis/dlg_list.ui', parent)<br><br> def prefill(self, title, data):<br> WizardDialog.prefill(self, title)<br><br> for id, text in data:<br> item = QListWidgetItem(text, self.listWidget)<br>
item.setData(Qt.UserRole, QVariant(id))<br><br> def setupUi(self, dialog):<br> WizardDialog.setupUi(self, self)<br> self.connect(dialog.listWidget, <br> SIGNAL('itemDoubleClicked(QListWidgetItem *)'), <br>
self.go_next)<br><br> def go_back(self):<br> print 'Back'<br><br> def go_next(self):<br> print 'Next'<br></span><span style="font-family: courier new,monospace;"></span><br>
Any help will be appreciated.<br>-- <br>Ruslan Popov<br>phone: +7 916 926 1205<br><br>