void MainWindow::setLanguage(const QString& str) // Установка языка{ QTranslator * translator = new QTranslator;translator->load(str,".");}
QApplication a(argc, argv);a.installTranslator(translator);
pmenu1->addAction("&Russian",&w,SLOT(setLanguage())); pmenu1->addAction("&German",&w,SLOT(setLanguage()));
C++ (Qt)//--------------------------------------------------------------------------------------void cUPicsMainWindow::changeEvent(QEvent *event){ if (event->type() == QEvent::LanguageChange) { // Menus pMFile->setTitle(tr("&File")); pMEdit->setTitle(tr("&Edit")); // Прочие объекты с tr() ... } else QMainWindow::changeEvent(event);}