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. How to use the QtLinguist, easy way?
QtWS25 Last Chance

How to use the QtLinguist, easy way?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtlinguistcmakewindows
18 Posts 5 Posters 2.7k 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.
  • J jsulm
    12 Jul 2023, 05:26

    @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

    msys2

    Why msys2? You should use MinGW and its terminal provided with Qt.

    A Offline
    A Offline
    Artem Shapovalov
    wrote on 12 Jul 2023, 05:37 last edited by
    #5

    @jsulm I have a Qt Creator 10.0.2. Where can I find this feature? I searched in Qt/Tools/mingw directory and didn't find any terminal application, just toolchain and some libraries and header files placed in linux-fashioned directory tree. I tried to open in QtCreator forlder in command prompt but it opens windows's cmd.exe in the project folder and this doesn't work with cmake.

    J 1 Reply Last reply 12 Jul 2023, 05:38
    0
    • A Artem Shapovalov
      12 Jul 2023, 05:37

      @jsulm I have a Qt Creator 10.0.2. Where can I find this feature? I searched in Qt/Tools/mingw directory and didn't find any terminal application, just toolchain and some libraries and header files placed in linux-fashioned directory tree. I tried to open in QtCreator forlder in command prompt but it opens windows's cmd.exe in the project folder and this doesn't work with cmake.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 12 Jul 2023, 05:38 last edited by
      #6

      @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

      didn't find any terminal application

      If you installed Qt for MinGW you will find it in Windows start menu.
      So, what exact Qt version did you install?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 12 Jul 2023, 05:56
      0
      • J jsulm
        12 Jul 2023, 05:38

        @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

        didn't find any terminal application

        If you installed Qt for MinGW you will find it in Windows start menu.
        So, what exact Qt version did you install?

        A Offline
        A Offline
        Artem Shapovalov
        wrote on 12 Jul 2023, 05:56 last edited by
        #7

        @jsulm I download the installer qt-unified-windows-x64-4.6.0-online.exe. I search in start menu and found Qt 6.5.1 (MinGW 11.2.0 64-bit) shortcut. Launched it, cd to project's directory and tried to run:

        cmake --build . --target <my project name>_lupdate
        

        and got an error:

        'cmake' is not recognized as an internal or external command, operable program or batch file
        

        Seems to be it's not configured well and looks like standard windows cmd.exe. May be I should set it up manually before use?

        J 1 Reply Last reply 12 Jul 2023, 05:59
        0
        • A Artem Shapovalov
          12 Jul 2023, 05:56

          @jsulm I download the installer qt-unified-windows-x64-4.6.0-online.exe. I search in start menu and found Qt 6.5.1 (MinGW 11.2.0 64-bit) shortcut. Launched it, cd to project's directory and tried to run:

          cmake --build . --target <my project name>_lupdate
          

          and got an error:

          'cmake' is not recognized as an internal or external command, operable program or batch file
          

          Seems to be it's not configured well and looks like standard windows cmd.exe. May be I should set it up manually before use?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 12 Jul 2023, 05:59 last edited by
          #8

          @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

          May be I should set it up manually before use?

          No, the shortcut in the Start menu should be fine. Maybe path to cmake executable is not configured automatically, but you can still use absolute path to cmake.exe.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply 12 Jul 2023, 06:07
          0
          • J jsulm
            12 Jul 2023, 05:59

            @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

            May be I should set it up manually before use?

            No, the shortcut in the Start menu should be fine. Maybe path to cmake executable is not configured automatically, but you can still use absolute path to cmake.exe.

            A Offline
            A Offline
            Artem Shapovalov
            wrote on 12 Jul 2023, 06:07 last edited by
            #9

            @jsulm I tried to run:

            C:\<path to cmake from Qt\cmake.exe --build . --target <my project name>_lupdate
            

            and got an error:

            Error: could not load cache
            

            What should I do before the build this target?

            K 1 Reply Last reply 12 Jul 2023, 07:11
            0
            • A Artem Shapovalov
              12 Jul 2023, 06:07

              @jsulm I tried to run:

              C:\<path to cmake from Qt\cmake.exe --build . --target <my project name>_lupdate
              

              and got an error:

              Error: could not load cache
              

              What should I do before the build this target?

              K Offline
              K Offline
              kkoehne
              Moderators
              wrote on 12 Jul 2023, 07:11 last edited by
              #10

              @Artem-Shapovalov

              Have you navigated to the build directory of the project (displayed in Qt Creator under Projects > Build Settings > Build Directory)?

              Anyhow, if you don't feel confident on the command line, you can also trigger the target from within Qt Creator: Press Ctrl+K (to open the navigator), and then type

              cm <my project name>_lupdate
              

              Director R&D, The Qt Company

              A E 2 Replies Last reply 12 Jul 2023, 07:19
              1
              • K kkoehne
                12 Jul 2023, 07:11

                @Artem-Shapovalov

                Have you navigated to the build directory of the project (displayed in Qt Creator under Projects > Build Settings > Build Directory)?

                Anyhow, if you don't feel confident on the command line, you can also trigger the target from within Qt Creator: Press Ctrl+K (to open the navigator), and then type

                cm <my project name>_lupdate
                
                A Offline
                A Offline
                Artem Shapovalov
                wrote on 12 Jul 2023, 07:19 last edited by
                #11

                @kkoehne I checked this feature and it's don't build unknown targets.

                @kkoehne , @jsulm , thank you guys, I explore a little bit more, but I decided to use another internationalization tool. Maybe later I would return to this Qt feature.

                K 1 Reply Last reply 12 Jul 2023, 07:42
                0
                • A Artem Shapovalov
                  12 Jul 2023, 07:19

                  @kkoehne I checked this feature and it's don't build unknown targets.

                  @kkoehne , @jsulm , thank you guys, I explore a little bit more, but I decided to use another internationalization tool. Maybe later I would return to this Qt feature.

                  K Offline
                  K Offline
                  kkoehne
                  Moderators
                  wrote on 12 Jul 2023, 07:42 last edited by
                  #12

                  @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

                  @kkoehne I checked this feature and it's don't build unknown targets.

                  THat's weird. If the target is 'unknown', then it doesn't exist in CMake, I'd claim.

                  @kkoehne , @jsulm , thank you guys, I explore a little bit more, but I decided to use
                  another internationalization tool. Maybe later I would return to this Qt feature.

                  Out of interest: Which tool are you going for?

                  Director R&D, The Qt Company

                  A 1 Reply Last reply 12 Jul 2023, 08:03
                  0
                  • K kkoehne
                    12 Jul 2023, 07:42

                    @Artem-Shapovalov said in How to use the QtLinguist, easy way?:

                    @kkoehne I checked this feature and it's don't build unknown targets.

                    THat's weird. If the target is 'unknown', then it doesn't exist in CMake, I'd claim.

                    @kkoehne , @jsulm , thank you guys, I explore a little bit more, but I decided to use
                    another internationalization tool. Maybe later I would return to this Qt feature.

                    Out of interest: Which tool are you going for?

                    A Offline
                    A Offline
                    Artem Shapovalov
                    wrote on 12 Jul 2023, 08:03 last edited by
                    #13

                    @kkoehne I write my own. Less than 100 lines of code, but at present moment cover all of my needs.

                    1 Reply Last reply
                    0
                    • K kkoehne
                      12 Jul 2023, 07:11

                      @Artem-Shapovalov

                      Have you navigated to the build directory of the project (displayed in Qt Creator under Projects > Build Settings > Build Directory)?

                      Anyhow, if you don't feel confident on the command line, you can also trigger the target from within Qt Creator: Press Ctrl+K (to open the navigator), and then type

                      cm <my project name>_lupdate
                      
                      E Offline
                      E Offline
                      ekkescorner
                      Qt Champions 2016
                      wrote on 22 Nov 2023, 11:31 last edited by ekkescorner
                      #14

                      @kkoehne now I'm fighting with this. just ported all my apps from 5.15 to 6.6 using QMake.
                      Now as next step: port from QMake to CMake
                      BTW: doing it all from inside QtCreator, no cmdline
                      all my apps rely on translations and this works well in 5.15/QMake:
                      changed strings - build project - external cmd lupdate - QtLinguist - extrernal cmd lrelease
                      External commands don't work as reported here.
                      tried with QtCreator Linguist Example arrowpad

                      qt6_add_translations(arrowpad
                          TS_FILES arrowpad_fr.ts arrowpad_nl.ts 
                          QM_FILES_OUTPUT_VARIABLE qm_files)
                      install(FILES ${qm_files} DESTINATION ${INSTALL_EXAMPLEDIR})
                      

                      added arrowpad_de.ts, saved CMakeLists.txt and the file was created.
                      build the project, but all .ts files are empty
                      tried your recommendation:

                      cm arrowpad_lupdate
                      

                      doesnt work. while typing (macOS) Cmd-Kcm arrowpad there's only arrowpad_lrelease listed but no arrowpad_lupdate
                      any idea ?

                      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                      5.15 --> 6.8 https://t1p.de/ekkeChecklist
                      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                      K 1 Reply Last reply 22 Nov 2023, 11:41
                      0
                      • E ekkescorner
                        22 Nov 2023, 11:31

                        @kkoehne now I'm fighting with this. just ported all my apps from 5.15 to 6.6 using QMake.
                        Now as next step: port from QMake to CMake
                        BTW: doing it all from inside QtCreator, no cmdline
                        all my apps rely on translations and this works well in 5.15/QMake:
                        changed strings - build project - external cmd lupdate - QtLinguist - extrernal cmd lrelease
                        External commands don't work as reported here.
                        tried with QtCreator Linguist Example arrowpad

                        qt6_add_translations(arrowpad
                            TS_FILES arrowpad_fr.ts arrowpad_nl.ts 
                            QM_FILES_OUTPUT_VARIABLE qm_files)
                        install(FILES ${qm_files} DESTINATION ${INSTALL_EXAMPLEDIR})
                        

                        added arrowpad_de.ts, saved CMakeLists.txt and the file was created.
                        build the project, but all .ts files are empty
                        tried your recommendation:

                        cm arrowpad_lupdate
                        

                        doesnt work. while typing (macOS) Cmd-Kcm arrowpad there's only arrowpad_lrelease listed but no arrowpad_lupdate
                        any idea ?

                        K Offline
                        K Offline
                        kkoehne
                        Moderators
                        wrote on 22 Nov 2023, 11:41 last edited by kkoehne
                        #15

                        @ekkescorner , have you actually tried running

                        cm arrowpad_lupdate
                        

                        from Qt Creator? For me the command never shows up in autocomplete (which needs to be studied, created https://bugreports.qt.io/browse/QTCREATORBUG-29946), but I can run it, with Qt 6.6.0.

                        Director R&D, The Qt Company

                        E 1 Reply Last reply 22 Nov 2023, 11:52
                        1
                        • K kkoehne
                          22 Nov 2023, 11:41

                          @ekkescorner , have you actually tried running

                          cm arrowpad_lupdate
                          

                          from Qt Creator? For me the command never shows up in autocomplete (which needs to be studied, created https://bugreports.qt.io/browse/QTCREATORBUG-29946), but I can run it, with Qt 6.6.0.

                          E Offline
                          E Offline
                          ekkescorner
                          Qt Champions 2016
                          wrote on 22 Nov 2023, 11:52 last edited by
                          #16

                          @kkoehne aaah. typing it it's working. was confused because autocomplete missed it.
                          THX - no I can go on to the next CMake features :)

                          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                          5.15 --> 6.8 https://t1p.de/ekkeChecklist
                          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            Adaita Kumar Behera
                            wrote on 12 May 2024, 08:51 last edited by Adaita Kumar Behera 5 Dec 2024, 08:54
                            #17

                            I was struggling with the same issue and I landed here. It helped. Now, I made the following changes to my cmake script to make it seamless.

                            add_custom_target(run_app_lupdate
                            COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target app_lupdate
                            COMMENT "Running app_lupdate"
                            )
                            add_dependencies(app run_app_lupdate)

                            Here "app' is the traget name

                            1 Reply Last reply
                            0
                            • E Offline
                              E Offline
                              ekkescorner
                              Qt Champions 2016
                              wrote on 12 May 2024, 09:49 last edited by
                              #18

                              you don't need this. Qt 6.7 / QtC 13.0:
                              there are automatically generated targets there, you can execute:
                              update_translations
                              release_translations

                              cm_update_translations

                              ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                              5.15 --> 6.8 https://t1p.de/ekkeChecklist
                              QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                              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