and again a problem .... this time with ui translations of c++ plugin.
I did:
- use english as ui language in sources and ui files
- generate .ui files with Qt designer
- surrounded strings in my c++-sources with tr() (or QObject::tr() ) (only those I want to be translated
- added the following code to my plugins postInit()
Code: Select all
QString locale = QLocale::system().name();
QTranslator translator;
translator.load(QString("ts/DACAD_") + locale);
qApp->installTranslator(&translator);
I translated all strings using linguist.
after this, lrelease generated a .qm file.
DACD_de.ts and DACD_de.qm were both copied to "qcad base directory"/ts.
I checked that after start of qcad translator.load() returns true.
Running the application shows that strings I set into the applications menu are translated to german (good).
However, the Dialogs from the .ui files show up in english (so untranslated, bad).
Any idea what I am missing???
Regards,
Ulrich