c++ - vc++ + QT translation of UI is not working -
i have project qt in vc++ , need locate string in ui different languages. created ui through qtdesigner in visual studio add in of visual studio 2012 , have installed qt plugin use qt features well.
i have created .pro file , added:
sources += main.cpp translations += languagefileqt_es.ts
after generate linguist file sources emminensmultiportqt_es.ts , detected correctly strings in iu. after that, generate .qm file using release function of qtlinguist.
my resources file is:
<rcc> <qresource prefix="myappqt"> <file>languagefileqt_es.qm</file> </qresource> </rcc>
then have added main.cpp:
qtranslator translator; bool loaded = translator.load("languagefileqt_es"); qdebug() << "loaded " << loaded; a.installtranslator(&translator);
and loaded returns true in cases. problem ui not translated when application executed. weird because has no effect.
any clue missing or check out?
thanks lot
are sure, "languagefileqt_es" correct name of language file? expect "languagefileqt_es.qm" instead.
are sure loading correct directory? unless loading internal compiled-in resource (:/languagefileqt_es.qm) should refer absolute path make sure, load correct thing.
Comments
Post a Comment