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. Can't get lupdate to work
Forum Updated to NodeBB v4.3 + New Features

Can't get lupdate to work

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.9k 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.
  • O Offline
    O Offline
    Odelphi
    wrote on last edited by
    #1

    I run the following command (as shown in the documentation) in my cmd program:
    D:\QTLinguist>lupdate counterpoint.qml -ts counterpoint_en.ts

    When it runs I get the following message
    Updating 'counterpoint_en.ts'...
    Found 0 source text(s) (0 new and 0 already existing).

    It creates the ts file, but when I try to open it with "linguist.exe" I get an error message telling me the ts file is blank and program ends.

    Any advice?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Odelphi said in Can't get lupdate to work:

      Any advice?

      Maybe give lupdate the path the the source files? How should it know where to look for them?
      See the documentation.

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

      O 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        @Odelphi said in Can't get lupdate to work:

        Any advice?

        Maybe give lupdate the path the the source files? How should it know where to look for them?
        See the documentation.

        O Offline
        O Offline
        Odelphi
        wrote on last edited by Odelphi
        #3

        @Christian-Ehrlicher Thank you for your response. The documentation I saw was very light on specifics about exactly how the command should be run. However, FYI, the qml file is in the same directory as the lupdate program. Windows will look in the current directory when a directory is not given. But just to be sure, I also ran the command by specifically indicating the exact location of the qml file in the command line. I also made sure the qml file is encoded in UTF-8 format. Still didn't work.

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Odelphi said in Can't get lupdate to work:

          Windows will look in the current directory when a directory is not given.

          Don't know what window should have to do with your problem

          But just to be sure, I also ran the command by specifically indicating the exact location of the qml file in the command line.

          I don't see where in the documentation this was stated. You have to either pass a .pro - file with all the sources or the sources lupdate should search via command line. lupdate --help is clear enough I would say:

          Usage:
          lupdate--help
          
          lupdate [options] [project-file]...
          lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file
          ...
          

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

          O 1 Reply Last reply
          2
          • Christian EhrlicherC Christian Ehrlicher

            @Odelphi said in Can't get lupdate to work:

            Windows will look in the current directory when a directory is not given.

            Don't know what window should have to do with your problem

            But just to be sure, I also ran the command by specifically indicating the exact location of the qml file in the command line.

            I don't see where in the documentation this was stated. You have to either pass a .pro - file with all the sources or the sources lupdate should search via command line. lupdate --help is clear enough I would say:

            Usage:
            lupdate--help
            
            lupdate [options] [project-file]...
            lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file
            ...
            
            O Offline
            O Offline
            Odelphi
            wrote on last edited by
            #5

            @Christian-Ehrlicher You just made my point. You said, "I don't see where in the documentation this was stated. " It is not stated in the documentation that you need to put the path, so I didn't (at first) but just to be sure, I ran it again with the path but it didn't make any difference. I wish I can send you the qml file so you can do it for me. As the song says, "I don't care". The qml file is a public file on Github so there is no copyright issue. I am just using it to learn how to do translations.
            You can go to: https://github.com/rogerioConstante/Contraponto
            If you get it to work, let me know and tell me specifically what you did to get it to work.
            BTW: I only have the lupdate, lconvert, lrelease and linguist programs on my computer. I don't need any other programs, dlls, cpps, py, or anything else on my computer to get it to work, do I?

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Odelphi said in Can't get lupdate to work:

              It is not stated in the documentation that you need to put the path

              Because the documentation just describes the straight-forward way when using a proper .pro - file what you do not.
              If you don't follow the normal way you have to dig into the problem by yourself. The first case is checking what the tool you want to use gives you as help... but looks like this is too much to ask.

              Your qml file has not a single translatable string so I don't expect that lupdate can do anything for you. Please read the documentation.

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

              O 1 Reply Last reply
              2
              • Christian EhrlicherC Christian Ehrlicher

                @Odelphi said in Can't get lupdate to work:

                It is not stated in the documentation that you need to put the path

                Because the documentation just describes the straight-forward way when using a proper .pro - file what you do not.
                If you don't follow the normal way you have to dig into the problem by yourself. The first case is checking what the tool you want to use gives you as help... but looks like this is too much to ask.

                Your qml file has not a single translatable string so I don't expect that lupdate can do anything for you. Please read the documentation.

                O Offline
                O Offline
                Odelphi
                wrote on last edited by
                #7

                @Christian-Ehrlicher
                You said, "Your qml file has not a single translatable string". What does that mean? I read the documentation, but it doesn't tell me what constitutes a "translatable string". All it says is, "The lupdate command line tool finds the translatable strings in the specified source, header and Qt Designer interface files, and produces or updates .ts translation files." I thought the program went through the qml file and put qstr( <quoted string>) around anything that has quote marks around it and then write an xml code for it.

                jsulmJ Christian EhrlicherC 2 Replies Last reply
                -1
                • O Odelphi

                  @Christian-Ehrlicher
                  You said, "Your qml file has not a single translatable string". What does that mean? I read the documentation, but it doesn't tell me what constitutes a "translatable string". All it says is, "The lupdate command line tool finds the translatable strings in the specified source, header and Qt Designer interface files, and produces or updates .ts translation files." I thought the program went through the qml file and put qstr( <quoted string>) around anything that has quote marks around it and then write an xml code for it.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by jsulm
                  #8

                  @Odelphi said in Can't get lupdate to work:

                  I thought the program went through the qml file and put qstr( <quoted string>)

                  No, it is you job to decide what needs to be translated and put it in qstr(). Why should a tool decide that?
                  It is even stated in the documentation: "Strings in QML can be marked for translation using the qsTr(), qsTranslate(), qsTrId(), QT_TR_NOOP(), QT_TRANSLATE_NOOP(), and QT_TRID_NOOP() functions." (link @Christian-Ehrlicher provided: https://doc.qt.io/qt-5/qtquick-internationalization.html).

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

                  1 Reply Last reply
                  4
                  • O Odelphi

                    @Christian-Ehrlicher
                    You said, "Your qml file has not a single translatable string". What does that mean? I read the documentation, but it doesn't tell me what constitutes a "translatable string". All it says is, "The lupdate command line tool finds the translatable strings in the specified source, header and Qt Designer interface files, and produces or updates .ts translation files." I thought the program went through the qml file and put qstr( <quoted string>) around anything that has quote marks around it and then write an xml code for it.

                    Christian EhrlicherC Online
                    Christian EhrlicherC Online
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Odelphi Not thinking, reading and gathering information before assuming something.

                    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

                    • Login

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