You are not logged in.

1

Tuesday, April 3rd 2012, 7:54pm

Problems with QTranslator

Hi guys and girls, I'm completely novice, and I'm completely blondie. I'm from Russia and I'm trying to translate my program on other languages. This is my project and it isn't working, maybe you can help me. It is without database, because it's too big to attach here....
Lynx-89 has attached the following file:
  • 5.zip (14.82 kB - 3 times downloaded - latest: Aug 23rd 2012, 5:41am)

2

Tuesday, April 3rd 2012, 8:11pm

where is your question?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

3

Tuesday, April 3rd 2012, 8:19pm

The main problem that Translation does not work, that means when I check sth from menu "Language" nothing happens. But all the signs in English would have to transfer to the selected menu language.

this is the connection

grpAct = new QActionGroup(this);
grpAct->addAction(ui->action_eng);
grpAct->addAction(ui->action_de);
grpAct->addAction(ui->action_rus);
grpAct->addAction(ui->action_esp);
grpAct->addAction(ui->action_ch);
connect(grpAct,SIGNAL(triggered(QAction*)),this,SLOT(SwitchLanguage(QAction*)));

this is the slot

void MainWindow::SwitchLanguage(QAction*)
{

if (ui->action_eng->isChecked()) {
translator.load("eng.qm","."); }
else if (ui->action_rus->isChecked()) {
translator.load("rus.qm","."); }
else if(ui->action_de->isChecked()) {
translator.load("de.qm","."); }
else if(ui->action_esp->isChecked()) {
translator.load("esp.qm","."); }
else {
translator.load("ch.qm","."); }

qApp->installTranslator(&translator);
ui->retranslateUi(this);
}