
Originally Posted by
whitefurrows
I do this e.g.:
void MyMainWindow::createActions()
{
actionOpen
= new QAction(QIcon(":/myPic.png"), tr
("&Open File"),
this);
}
void MyMainWindow::createActions()
{
actionOpen = new QAction(QIcon(":/myPic.png"), tr("&Open File"), this);
}
To copy to clipboard, switch view to plain text mode
and i must do this:
void MyMainWindow::retranslate()
{
actionOpen->setText(tr("&Datei öffnen"));
}
void MyMainWindow::retranslate()
{
actionOpen->setText(tr("&Datei öffnen"));
}
To copy to clipboard, switch view to plain text mode
I think that’s dirty and a lot to do, but it’s OK.
Hmm, you are not supposed to hardcode all the languages in the code. Use only one string in code and then use translation files to translate it to any language you want.
void MyMainWindow::createActions()
{
actionOpen
= new QAction(QIcon(":/myPic.png"), tr
("&Open File"),
this);
}
void MyMainWindow::retranslate()
{
actionOpen->setText(tr("&Open File")); // same string here, put "&Datei öffnen" into the translation file
}
void MyMainWindow::createActions()
{
actionOpen = new QAction(QIcon(":/myPic.png"), tr("&Open File"), this);
}
void MyMainWindow::retranslate()
{
actionOpen->setText(tr("&Open File")); // same string here, put "&Datei öffnen" into the translation file
}
To copy to clipboard, switch view to plain text mode
Bookmarks