Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How to create translation files (.ts) in our project from lupdate command?

How to create translation files (.ts) in our project from lupdate command?

Scheduled Pinned Locked Moved Solved Qt 6
qt creatorqt6translationlupdat
4 Posts 3 Posters 4.1k 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
    gouneken
    wrote on 17 Dec 2021, 22:11 last edited by
    #1

    Good evening, I am writing to you because I created a project and I wanted to translate it into English and Spanish languages. I made the modifications I had to make in my code to specify the functionalities to translate. Then I introduced in the .pro file of my project on QtCreator the following lines:
    TRANSLATIONS +=
    zeroclassgenerator_en.ts
    zeroclassgenerator_es.ts \

    In the Qt command prompt I wrote:
    lupdate "C:\Users\user\Documents\ZeroClassGenerator\ZeroClassGenerator.pro"
    But I am told : Info: creating stash file C:\QtSdk2\6.2.1\mingw81_64.qmake.stash
    lupdate warning: no TS files specified. Only diagnostics will be produced for 'C:/Users/user/Documents/ZeroClassGenerator/ZeroClassGenerator.pro'.

    In the end, the .ts files were not generated in my project. I don't know where my mistake is. Thank you in advance for your answers.

    J 1 Reply Last reply 18 Dec 2021, 10:23
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 18 Dec 2021, 09:02 last edited by
      #2

      As described in the documentation you have to specify the ts file to update/create after the sources / pro-file which contains the sources

      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
      1
      • G gouneken
        17 Dec 2021, 22:11

        Good evening, I am writing to you because I created a project and I wanted to translate it into English and Spanish languages. I made the modifications I had to make in my code to specify the functionalities to translate. Then I introduced in the .pro file of my project on QtCreator the following lines:
        TRANSLATIONS +=
        zeroclassgenerator_en.ts
        zeroclassgenerator_es.ts \

        In the Qt command prompt I wrote:
        lupdate "C:\Users\user\Documents\ZeroClassGenerator\ZeroClassGenerator.pro"
        But I am told : Info: creating stash file C:\QtSdk2\6.2.1\mingw81_64.qmake.stash
        lupdate warning: no TS files specified. Only diagnostics will be produced for 'C:/Users/user/Documents/ZeroClassGenerator/ZeroClassGenerator.pro'.

        In the end, the .ts files were not generated in my project. I don't know where my mistake is. Thank you in advance for your answers.

        J Offline
        J Offline
        J.Hilk
        Moderators
        wrote on 18 Dec 2021, 10:23 last edited by
        #3

        @gouneken the easiest will be, to skip the command line entirely.

        You are using QtCreator, at least you said so, select
        Tools -> External -> update translations

        make sure you selected the correct kit beforehand, for some reason, lupdate from android and iOS kits fail to generate any ts files, but the desktop kits work just fine.


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        G 1 Reply Last reply 19 Dec 2021, 16:01
        2
        • J J.Hilk
          18 Dec 2021, 10:23

          @gouneken the easiest will be, to skip the command line entirely.

          You are using QtCreator, at least you said so, select
          Tools -> External -> update translations

          make sure you selected the correct kit beforehand, for some reason, lupdate from android and iOS kits fail to generate any ts files, but the desktop kits work just fine.

          G Offline
          G Offline
          gouneken
          wrote on 19 Dec 2021, 16:01 last edited by
          #4

          @J-Hilk Thanks, even though that was not the answer I expected, you showed me a shortcut that saves me from using the command line. It will save me time. Have a nice day!

          1 Reply Last reply
          1

          2/4

          18 Dec 2021, 09:02

          • Login

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