Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-107852

qt6_add_translations() does not detect translatable strings

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      1. In Qt Creator, load the CMakeLists.txt file for the Hello tr() Example (https://doc.qt.io/qt-6/qtlinguist-hellotr-example.html )
      2. Build the project and inspect the contents of hellotr_la.ts

       

      Actual Outcomes

      Console output:

      [1/6 16.1/sec] Generating C:/Qt/Examples/Qt-6.4.0/linguist/hellotr/hellotr_la.ts
      Updating '../hellotr/hellotr_la.ts'...
          Found 0 source text(s) (0 new and 0 already existing)
      [2/6 19.1/sec] Generating hellotr_la.qm
      Updating 'C:/Qt/Examples/Qt-6.4.0/linguist/build-hellotr-Desktop_Qt_6_4_0_MSVC2019_64bit-Debug/hellotr_la.qm'...
          Generated 0 translation(s) (0 finished and 0 unfinished)
      

       

      hellotr_la.ts contents:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1" language="la_VA">
      </TS>
      

       

      Expected Outcomes

      This can be achieved by manually running lupdate hellotr.pro from the console.

      Console output:

      Updating 'hellotr_la.ts'...
          Found 1 source text(s) (1 new and 0 already existing)
      

       

      hellotr_la.ts contents:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1" language="la_VA">
      <context>
          <name>QPushButton</name>
          <message>
              <location filename="main.cpp" line="27"/>
              <source>Hello world!</source>
              <translation type="unfinished"></translation>
          </message>
      </context>
      </TS>
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kkohne Kai Köhne
              jksh Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes