I understand that there is a simple way - just assign right string when UI has loaded. But may be there is UI-way...
On Thu, Jun 17, 2010 at 10:16 PM, Ruslan Popov <[email protected]>wrote: > Hi all, > > I work on simple wizard. I define each type of dialog as *.ui and have the > translation problem. > How can I translate string defined in *.ui? > > For instance, I want to see this: > > <widget class="QLabel" name="label"> > <property name="text"> > <string>Make your choice:</string> > </property> > </widget> > > as this when using russian locale: > > <widget class="QLabel" name="label"> > <property name="text"> > <string>Сделайте свой выбор:</string> > </property> > </widget> > > > Some of sources: > class WizardDialog(QDialog): > > def __init__(self, ui_file, parent=None, params=dict()): > QDialog.__init__(self, parent) > > dlg = uic.loadUi(ui_file, self) > self.setupUi(dlg) > > def prefill(self, title): > self.setWindowTitle(title) > > def setupUi(self, dialog): > self.connect(dialog.goBack, SIGNAL('clicked()'), self.go_back) > self.connect(dialog.goNext, SIGNAL('clicked()'), self.go_next) > > def go_back(self): > print 'Back button pressed' > > def go_next(self): > print 'Next button pressed' > > class WizardListDlg(WizardDialog): > > def __init__(self, parent=None, params=dict()): > WizardDialog.__init__(self, 'uis/dlg_list.ui', parent) > > def prefill(self, title, data): > WizardDialog.prefill(self, title) > > for id, text in data: > item = QListWidgetItem(text, self.listWidget) > item.setData(Qt.UserRole, QVariant(id)) > > def setupUi(self, dialog): > WizardDialog.setupUi(self, self) > self.connect(dialog.listWidget, > SIGNAL('itemDoubleClicked(QListWidgetItem *)'), > self.go_next) > > def go_back(self): > print 'Back' > > def go_next(self): > print 'Next' > > Any help will be appreciated. > -- > Ruslan Popov > phone: +7 916 926 1205 > > -- Ruslan Popov phone: +7 916 926 1205
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
