Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. CMake + QtLinguist generates empty TS files
Forum Update on Monday, May 27th 2025

CMake + QtLinguist generates empty TS files

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 607 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.
  • G Offline
    G Offline
    G_ka
    wrote on last edited by G_ka
    #1

    Hey,
    I'm trying to automate the generation of TS and QM files. I'm using CMake.
    The TS and QM files are correctly created, but they are empty. What am I doing wrong?
    Here's my CMakeLists
    Do you have any idea? Thanks

    Pablo J. RoginaP 1 Reply Last reply
    0
    • G G_ka

      Hey,
      I'm trying to automate the generation of TS and QM files. I'm using CMake.
      The TS and QM files are correctly created, but they are empty. What am I doing wrong?
      Here's my CMakeLists
      Do you have any idea? Thanks

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @G_ka disclaimer: not that I've used Qt translation files via CMake. However, from your CMakeLists file:

      message("Updating translations files")
      qt5_create_translation(QM_FILES ${TS_FILES} ${SOURCES} ${HEADERS} ${UI})
      

      and checking documentation, it seems your passing arguments in wrong order

      qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} helloworld_en.ts helloworld_de.ts)
      

      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

      G 1 Reply Last reply
      1
      • Pablo J. RoginaP Pablo J. Rogina

        @G_ka disclaimer: not that I've used Qt translation files via CMake. However, from your CMakeLists file:

        message("Updating translations files")
        qt5_create_translation(QM_FILES ${TS_FILES} ${SOURCES} ${HEADERS} ${UI})
        

        and checking documentation, it seems your passing arguments in wrong order

        qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} helloworld_en.ts helloworld_de.ts)
        
        G Offline
        G Offline
        G_ka
        wrote on last edited by
        #3

        @Pablo-J-Rogina
        Thank you. I was going to try your solution, but it looks like it fixed itself. Sorry for wasting your time, I guess I had to clean files or something like that.

        Pablo J. RoginaP 1 Reply Last reply
        0
        • G G_ka

          @Pablo-J-Rogina
          Thank you. I was going to try your solution, but it looks like it fixed itself. Sorry for wasting your time, I guess I had to clean files or something like that.

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @G_ka said in CMake + QtLinguist generates empty TS files:

          it looks like it fixed itself

          ok, so when you confirm the issue is solved please don't forget to mark your post as such! Thanks

          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

          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