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

lupdate truncates JavaScript template literal strings

XMLWordPrintable

    • 9d323c976 (dev), d011e3c51 (dev)

      Code

      import QtQuick
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
      
          Column {
              Text {
                  text: qsTr("Width: %1 Height: %2").arg(root.width).arg(root.height)
              }
              Text {
                  text: qsTr(`Width: ${root.width} Height: ${root.height}`)
              }
          }
      }
      

       

      lupdate output

      • The first line is processed as <source>Width: %1 Height: %2</source> (Expected)
      • The second line is processed as <source>Width: </source> (Not Expected)
      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1">
      <context>
          <name>Main</name>
          <message>
              <location filename="Main.qml" line="11"/>
              <source>Width: %1 Height: %2</source>
              <translation type="unfinished"></translation>
          </message>
          <message>
              <location filename="Main.qml" line="14"/>
              <source>Width: </source>
              <translation type="unfinished"></translation>
          </message>
      </context>
      </TS>
      

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

            masoud.jami Masoud Jami
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes