ui(new Ui::MainWindow), m_signalsIsBlocked(false)
{
ui->setupUi(this);
//........................
//..........................
CreateActions();
//......................
}
void MainWindow::CreateActions()
{
connect(minimizeAction, SIGNAL(triggered()), this, SLOT(on_actionMinimize_triggered()));
maximizeAction
= new QAction(tr
("Ma&ximize"),
this);
connect(maximizeAction, SIGNAL(triggered()), this, SLOT(on_actionMaximize_triggered()));
restoreAction
= new QAction(tr
("&Restore"),
this);
connect(restoreAction, SIGNAL(triggered()), this, SLOT(on_actionRestore_triggered()));
quitAction
= new QAction(tr
("&Quit"),
this);
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
ui(new Ui::MainWindow), m_signalsIsBlocked(false)
{
ui->setupUi(this);
//........................
//..........................
CreateActions();
//......................
}
void MainWindow::CreateActions()
{
minimizeAction = new QAction(QObject::tr("Mi&nimize"), this);
connect(minimizeAction, SIGNAL(triggered()), this, SLOT(on_actionMinimize_triggered()));
maximizeAction = new QAction(tr("Ma&ximize"), this);
connect(maximizeAction, SIGNAL(triggered()), this, SLOT(on_actionMaximize_triggered()));
restoreAction = new QAction(tr("&Restore"), this);
connect(restoreAction, SIGNAL(triggered()), this, SLOT(on_actionRestore_triggered()));
quitAction = new QAction(tr("&Quit"), this);
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
}
To copy to clipboard, switch view to plain text mode
Then I make *.ts by using lupdate, after that translate strings and make *.qm by using lrelease.
QString langFile
(":/i18n/vdynclient_ru_RU.qm");
// Russian translation appTrans.load(langFile);
a.installTranslator(&appTrans);
QApplication a(argc, argv);
QTranslator appTrans;
QString langFile(":/i18n/vdynclient_ru_RU.qm"); // Russian translation
appTrans.load(langFile);
a.installTranslator(&appTrans);
To copy to clipboard, switch view to plain text mode
But I get translated strings only for tray context menu, but not for all interface.
QString transl
= appTrans.
translate("MainContext",
"Your E-mail:");
QString transl = appTrans.translate("MainContext", "Your E-mail:");
To copy to clipboard, switch view to plain text mode
And got correct translation, cause one exists, but why isn`t it displayed on the form (every time I see only english words)?
Bookmarks