[solved] Translating (static lib) and main application.

  • Hi,
    my application uses standard qt translations. This works fine.
    Now i wrote a new (static) library which internally also has string to translate.
    So i added translation file to the .pro file of the lib and translated everything.
    Then i used lrelease to get the qm file for the translated lib.
    This qm file i added into my main application resource file.

    Now my problem is my main application resource file has 2 .qm files one for itself and one from the lib.

    If i call QTranslator load(....) only the last translation gets applied.

    How can i add both qm files at runtime?

    Any ideas?


  • Lifetime Qt Champion


    AFAIK, you can load several translation files, however they'll be search in reverse order so the last one installed is the first searched. Now the search will stop at the first occurrence of a matching string.

    What is your exact use case ?

  • Okay solved it.

    i use

    @lconvert -i TS_FILE1.ts TS_FILE2.ts -o MAIN_TS_FILE.ts@

    then only use MAIN_TS_FILE.ts


Log in to reply