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

lupdate can not update empty strings in .ts file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.2
    • Tools: Linguist
    • None
    • Windows 10 / ubuntu 22.04

    Description

      Assuming a sample foo.qml file here including qsTr() marked empty strings (although I know it's wrong to mark empty strings e.g. typo or not everyone is familiar with linguist) :

       

      import QtQuick
      Rectangle {
          width: 360
          height: 360
          Text {
              id:t1
              anchors.centerIn: parent
              text: qsTr("")
          }
       
          Text {
              id:t2
              anchors.centerIn: parent
              text: qsTr("text one")
          }
      }
      

       

      then we using

      lupdate foo.qml -ts test.ts
      
      >> Updating 'test.ts'...
       Found 1 source text(s) (1 new and 0 already existing)

      but in the .ts file we will have two source strings:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1">
      <context>
          <name>foo</name>
          <message>
              <location filename="foo.qml" line="9"/>
              <source></source>
              <translation type="unfinished"></translation>
          </message>
          <message>
              <location filename="foo.qml" line="15"/>
              <source>text one</source>
              <translation type="unfinished"></translation>
          </message>
      </context>
      </TS>

       

      when I remove the qsTr() for empty strings, and run lupdate again, the .ts file will not be updated but in message we can see some changes:

      >> Found 1 source text(s) (0 new and 1 already existing)

      even if we remove other tagged strings, empty strings are still left in the .ts file.

      Expected Behavior: Unmarked source strings should be updated into .ts files (such as marked obsolete or someting).

       

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            shunwang Shun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes