Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] Translating (static lib) and main application.
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 856 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nando76
    wrote on last edited by
    #1

    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?

    Greetings
    Nando

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nando76
        wrote on last edited by
        #3

        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

        Greetings
        Nando

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved