[SOLVED]Application calling many plugins (dlls) - do each of the dlls need to have a QTranslator (and a QApplication)

  • The exe runs a menu structure which is used to load plugins/addons/dlls whatever you want to call them. Do they each need a QTranslator and if so do they each need a QApplication - each dll has its own translation file.

  • I think there should be exactly one instance of QApplication in your application. Create it in your "main" EXE and let the Plugin-DLL's get the single instance via the static function QApplication::instance().

    Furthermore, I think each plug-in DLL will need its own translation and thus its own translator, because only the plug-in DLL can know which strings it contains and how they need to be translated, i.e. there will be a separate .ts and thus a spearate .qm file for each plug-in DLL, probably compiled into the individual DLL as a resource...


    From the docs:

    bq. Multiple translation files can be installed. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched first and the first translation file installed is searched last. The search stops as soon as a translation containing a matching string is found.

  • Thanks. I thought that was the case.

    My plan was to give each addin a Translator my difficulty then is how do I account for the QML translation? Information is passed to the QML from c++ side, loading the pro translation gives me those strings but I have to translate the QML strings too - is it just a question of putting all strings in QML or c++?

    Ahhhh, I cracked it

    SOURCES = main.qml

Log in to reply