class A{... QString tr( const char * sourceText ) { return QObject::tr( sourceText, "A" ); }...}
QString str = QT_TRANSLATE_NOOP( "class A", "A" );
static const char *pluginName = QT_TRANSLATE_NOOP("PluginName", "TVChat");extern "C" QString CSISPluginName() { //return c_PluginName; return qApp->translate("PluginName", pluginName); }
extern "C" QString CSISPluginName() { QTranslator myappTranslator; myappTranslator.load(":translations/tvchat_ru.qm"); qApp->installTranslator(&myappTranslator); //return c_PluginName; return qApp->translate("PluginName", pluginName); }
QTranslator myappTranslator;myappTranslator.load(":translations/tvchat_ru.qm"); qApp->installTranslator(&myappTranslator);
QApplication a(argc, argv);QTranslator translator;translator.load(QString("applicationName_") + QLocale::system().name());a.installTranslator(&translator);
bool ClockPlugin::initPlugin(QMainWindow *parent,void* session,QString& intName) { _mParent=parent; QCoreApplication* app=QCoreApplication::instance(); QString locale = QLocale::system().name(); translator=new QTranslator; if (translator->load(QString("df_iClock_") + locale)) app->installTranslator(translator);