Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.6, 6.7.2, 6.8.0 Beta2
-
9d323c976 (dev), d011e3c51 (dev)
Description
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>
Attachments
Issue Links
- resulted in
-
QTBUG-130783 Support template strings for translation in QML files
-
- Open
-
For Gerrit Dashboard: QTBUG-127527 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
600645,2 | lupdate: template literal strings in ts files | dev | qt/qttools | Status: ABANDONED | 0 | +1 |
600950,4 | lupdate: Warn the user on using template strings for translation | dev | qt/qttools | Status: MERGED | +2 | +1 |
600957,5 | Document the limitation of using string templates in QML | dev | qt/qtdoc | Status: MERGED | +2 | 0 |