Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Deploying translation .qm files
Qt 6.11 is out! See what's new in the release blog

Deploying translation .qm files

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 3 Posters 2.6k 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.
  • V Offline
    V Offline
    vlada
    wrote on last edited by
    #1

    Hi,

    I have a localized application. I have the .qm files and if I copy them to the program directory on desktop, it works fine.

    But if compile my application for Android the translation files are not copied to the APK. I think I need to add something to my .pro file so that QtCreator knows that it should include those files. But I could not find how to do it.

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

      Hi,

      You need to add them to QMAKE_BUNDLE_DATA so they will be copied over. However, with translation file, it's also pretty usual to embed them in your application using Qt's resource system.

      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
      1
      • V Offline
        V Offline
        vlada
        wrote on last edited by
        #3

        Thank you, I looked at the Qt Resource System documentation and found the correct solution.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          portegael
          wrote on last edited by
          #4

          Hello,

          I am not sure how to use the QMAKE_BUNDLE_DATA to my Android APK.

          I have tried different things but nothing successful so far. Would you have more tips to give me ?

          Thanks in advance.

          Gaël

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

            Hi,

            it's explained here

            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
            • V Offline
              V Offline
              vlada
              wrote on last edited by
              #6

              But the documentation says: This variable is used on OS X and iOS only.

              I managed to add the translation files to my Android application using .qrc file. And it works for other platforms too.

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

                My bad, for Android you can use the assets file system. You can use that when you have to embed e.g. multimedia assets.

                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

                • Login

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