void MainWindow::SwitchLanguage(QAction*){ QTranslator translator; 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);}
C++ (Qt)translator.load(QString("%1.qm").arg(grpAct->checkedAction()->data().toString()))