I put them in the main function.
int main(int argc, char *argv[])
{
newTranslator.load( "pseism_translation/satellite3d_zh.qm");
a.installTranslator( &newTranslator );
qtTranslator.load( "pseism_translation/qt_zh_CN.qm");
a.installTranslator( &qtTranslator );
Ogre3dFrame
*frame
=new Ogre3dFrame
(QString(argv
[1]),
QString(argv
[2]));
frame->show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTranslator newTranslator;
newTranslator.load( "pseism_translation/satellite3d_zh.qm");
a.installTranslator( &newTranslator );
QTranslator qtTranslator;
qtTranslator.load( "pseism_translation/qt_zh_CN.qm");
a.installTranslator( &qtTranslator );
Ogre3dFrame *frame=new Ogre3dFrame(QString(argv[1]),QString(argv[2]));
frame->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Strings in the Ogre3dFrame have been translated,Must I load traslator in the other class?how to realize it,for there only is "QApplication a(argc, argv);" in the main function ,and not in the other class.
Bookmarks