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. Is there a way to use the translations from qt library combined with that from user's application?
Forum Updated to NodeBB v4.3 + New Features

Is there a way to use the translations from qt library combined with that from user's application?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 353 Views 2 Watching
  • 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.
  • S Offline
    S Offline
    Sauntor
    wrote on last edited by
    #1

    If your app has its own translation files(myapp.ts) and it supplies a About Qt dialog via QMessageBox::aboutQt(), then, the message shown by aboutQt() will not be translated!
    What's the solution? Or there is no solution?

    Chris KawaC 1 Reply Last reply
    0
    • Chris KawaC Chris Kawa

      You need to deploy Qt modules translation files located in your Qt installation directory along with translation files of your app. See the documentation.

      S Offline
      S Offline
      Sauntor
      wrote on last edited by
      #3

      @Chris-Kawa After trying, I find it out.
      Each QTranslator can only hold the translations it load() at last.
      But one QCoreApplication can installTranslator() for many times and use all of them for translating😂

      So, the solution is creating one QTranslator for Qt, and one for your app, finally, install them all to your app.

      Chris KawaC 1 Reply Last reply
      0
      • S Sauntor

        If your app has its own translation files(myapp.ts) and it supplies a About Qt dialog via QMessageBox::aboutQt(), then, the message shown by aboutQt() will not be translated!
        What's the solution? Or there is no solution?

        Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #2

        You need to deploy Qt modules translation files located in your Qt installation directory along with translation files of your app. See the documentation.

        S 1 Reply Last reply
        1
        • Chris KawaC Chris Kawa

          You need to deploy Qt modules translation files located in your Qt installation directory along with translation files of your app. See the documentation.

          S Offline
          S Offline
          Sauntor
          wrote on last edited by
          #3

          @Chris-Kawa After trying, I find it out.
          Each QTranslator can only hold the translations it load() at last.
          But one QCoreApplication can installTranslator() for many times and use all of them for translating😂

          So, the solution is creating one QTranslator for Qt, and one for your app, finally, install them all to your app.

          Chris KawaC 1 Reply Last reply
          0
          • S Sauntor has marked this topic as solved on
          • S Sauntor

            @Chris-Kawa After trying, I find it out.
            Each QTranslator can only hold the translations it load() at last.
            But one QCoreApplication can installTranslator() for many times and use all of them for translating😂

            So, the solution is creating one QTranslator for Qt, and one for your app, finally, install them all to your app.

            Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Sauntor Or, like the documentation I linked suggests, merge all translations into one file using lconvert.

            1 Reply Last reply
            1

            • Login

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