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. Successfully loaded .qm files, but translator remained empty
Forum Updated to NodeBB v4.3 + New Features

Successfully loaded .qm files, but translator remained empty

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 4 Posters 2.2k 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
    SGaist
    Lifetime Qt Champion
    wrote on 12 Nov 2019, 22:51 last edited by
    #4

    That seems pretty small for a translation file. Do you have any text translated ?

    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
    • Q QTLeearn
      12 Nov 2019, 20:18

      @SGaist I opened the .qm files in Qt creator, there are data displayed. Also I used the size() of QFile to check, it is 23 bytes, so I guess the .qm file is not empty

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 12 Nov 2019, 23:49 last edited by
      #5

      @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

      I opened the .qm files

      Please describe how do you created those .qm files.

      As @SGaist said, the size (23 bytes) seems pretty small.
      How many strings have you translated in the .ts files?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      Q 2 Replies Last reply 13 Nov 2019, 01:14
      0
      • P Pablo J. Rogina
        12 Nov 2019, 23:49

        @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

        I opened the .qm files

        Please describe how do you created those .qm files.

        As @SGaist said, the size (23 bytes) seems pretty small.
        How many strings have you translated in the .ts files?

        Q Offline
        Q Offline
        QTLeearn
        wrote on 13 Nov 2019, 01:14 last edited by
        #6

        @Pablo-J-Rogina In QML text type I use qsTrID(), with //% //: etc. I used lupdate, lrelease to create .qm files. The program could successfully locate these qm files.
        Since I only have about 28 occurrences of text in QML so I don't think the .qm file is too small

        1 Reply Last reply
        0
        • P Pablo J. Rogina
          12 Nov 2019, 23:49

          @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

          I opened the .qm files

          Please describe how do you created those .qm files.

          As @SGaist said, the size (23 bytes) seems pretty small.
          How many strings have you translated in the .ts files?

          Q Offline
          Q Offline
          QTLeearn
          wrote on 13 Nov 2019, 03:13 last edited by
          #7

          @Pablo-J-Rogina Wait.... The project above is just an example, I also generated .qm files from another project( different amount of texts for sure), the weird thing was the qm file size was also 23 bytes.... I doubt whether the qm files were successfully generated?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 13 Nov 2019, 05:58 last edited by
            #8

            @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

            I doubt whether the qm files were successfully generated?

            As @Pablo-J-Rogina already asked - did you actually did some translations in your ts files?

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            Q 1 Reply Last reply 13 Nov 2019, 15:25
            0
            • C Christian Ehrlicher
              13 Nov 2019, 05:58

              @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

              I doubt whether the qm files were successfully generated?

              As @Pablo-J-Rogina already asked - did you actually did some translations in your ts files?

              Q Offline
              Q Offline
              QTLeearn
              wrote on 13 Nov 2019, 15:25 last edited by QTLeearn
              #9

              @Christian-Ehrlicher We haven't implemented translations yet, as in .ts files:
              <translation type="unfinished"></translation>
              However there should be real texts displayed instead of the text IDs.

              I first generated ts files by clicking Tools->External->Linguistic ->update in Qt creator, then by clicking release I created qm files. I also tried to use lupdate command to generate ts files, but errors occurred:
              lupdate: could not exec '/usr/lib/qt5/bin/lupdate': No such file or directory

              I doubt there are kits related to language of Qt I didn't install? Thank you again for your help!

              P 1 Reply Last reply 13 Nov 2019, 15:42
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 13 Nov 2019, 15:32 last edited by
                #10

                How did you install Qt ?

                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
                • Q QTLeearn
                  13 Nov 2019, 15:25

                  @Christian-Ehrlicher We haven't implemented translations yet, as in .ts files:
                  <translation type="unfinished"></translation>
                  However there should be real texts displayed instead of the text IDs.

                  I first generated ts files by clicking Tools->External->Linguistic ->update in Qt creator, then by clicking release I created qm files. I also tried to use lupdate command to generate ts files, but errors occurred:
                  lupdate: could not exec '/usr/lib/qt5/bin/lupdate': No such file or directory

                  I doubt there are kits related to language of Qt I didn't install? Thank you again for your help!

                  P Offline
                  P Offline
                  Pablo J. Rogina
                  wrote on 13 Nov 2019, 15:42 last edited by
                  #11

                  @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

                  <translation type="unfinished"></translation>

                  To my understanding, "unfinished" translations don't prevent the process to go on and get the proper .qm files. Those "unfinished" strings will show up with a question mark in Linguist to let the translator now some attention in needed.

                  instead of the text IDs.

                  1. Could you elaborate what the text IDs are?
                  2. Could you please should a snippet of the source code with the qsTrID() entries

                  lupdate: could not exec '/usr/lib/qt5/bin/lupdate': No such file or directory

                  Please remember that you can run lupdate manually (i.e. from command line). Although you need to locate a proper lupdate executable first.

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  Q 1 Reply Last reply 13 Nov 2019, 16:05
                  0
                  • P Pablo J. Rogina
                    13 Nov 2019, 15:42

                    @QTLeearn said in Successfully loaded .qm files, but translator remained empty:

                    <translation type="unfinished"></translation>

                    To my understanding, "unfinished" translations don't prevent the process to go on and get the proper .qm files. Those "unfinished" strings will show up with a question mark in Linguist to let the translator now some attention in needed.

                    instead of the text IDs.

                    1. Could you elaborate what the text IDs are?
                    2. Could you please should a snippet of the source code with the qsTrID() entries

                    lupdate: could not exec '/usr/lib/qt5/bin/lupdate': No such file or directory

                    Please remember that you can run lupdate manually (i.e. from command line). Although you need to locate a proper lupdate executable first.

                    Q Offline
                    Q Offline
                    QTLeearn
                    wrote on 13 Nov 2019, 16:05 last edited by
                    #12

                    @Pablo-J-Rogina I can show you an example of the qsTrId()

                    //% "LAST CASE
                    labelText: qsTrId("TEXT_BUTTON_LAST_CASE")
                    

                    In the .ts file there's:

                    <message id="TEXT_BUTTON_LAST_CASE">
                            <location filename="../Resources/HomeScreen.qml" line="124"/>
                            <source>LAST CASE</source>
                            <translation type="unfinished"></translation>
                    </message>
                    

                    correspondingly

                    P 1 Reply Last reply 13 Nov 2019, 17:39
                    0
                    • Q QTLeearn
                      13 Nov 2019, 16:05

                      @Pablo-J-Rogina I can show you an example of the qsTrId()

                      //% "LAST CASE
                      labelText: qsTrId("TEXT_BUTTON_LAST_CASE")
                      

                      In the .ts file there's:

                      <message id="TEXT_BUTTON_LAST_CASE">
                              <location filename="../Resources/HomeScreen.qml" line="124"/>
                              <source>LAST CASE</source>
                              <translation type="unfinished"></translation>
                      </message>
                      

                      correspondingly

                      P Offline
                      P Offline
                      Pablo J. Rogina
                      wrote on 13 Nov 2019, 17:39 last edited by
                      #13

                      @QTLeearn it looks like your .qm file(s) are empty.
                      Even with no translations provided at all (no "LAST CASE") if the .qm file was properly built and loaded, you should see "TEXT_BUTTON_LAST_CASE" as the "translated" string

                      So you need to do the lupdate / translations (Linguist) / lrelease process properly.

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      Q 1 Reply Last reply 14 Nov 2019, 15:34
                      0
                      • P Pablo J. Rogina
                        13 Nov 2019, 17:39

                        @QTLeearn it looks like your .qm file(s) are empty.
                        Even with no translations provided at all (no "LAST CASE") if the .qm file was properly built and loaded, you should see "TEXT_BUTTON_LAST_CASE" as the "translated" string

                        So you need to do the lupdate / translations (Linguist) / lrelease process properly.

                        Q Offline
                        Q Offline
                        QTLeearn
                        wrote on 14 Nov 2019, 15:34 last edited by QTLeearn
                        #14

                        @Pablo-J-Rogina You are right, I guess some linguistic tools were not installed. When I tried to generate .qm files, Qt creator printed out messages:

                        Generated 0 translation(s) (0 finished and 0 unfinished)
                        Ignored 27 untranslated source text(s)
                        Updating '/TransDemo/languages/lang_de.qm'...

                        1 Reply Last reply
                        0
                        • C Offline
                          C Offline
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on 14 Nov 2019, 17:45 last edited by
                          #15

                          I don't see anything wrong with those messages - you did not yet translate any message in your ts file so the output is correct.

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          0

                          13/15

                          13 Nov 2019, 17:39

                          • Login

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