Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.1, 6.9.0 Beta1
-
6474c654e (dev), 4ba99033b (6.9), 7d56cf0e9 (6.8), 5b5136ca4 (tqtc/lts-6.5)
Description
Using QT_TR_NOOP with a disambiguation string to mark a ListElement string causes a "ListElement: cannot use script for property value" run-time error.
ListModel { ListElement { name: QT_TR_NOOP("Apple", "Apple comment") // causes "ListElement: cannot use script for property value" run-time error } }
lupdate correctly generates the TS file containing the disambiguation string in the <comment> element tag as expected, and the error does not occur if the disambiguation string is omitted.
The same behavior is observed when using QT_TRANSLATE_NOOP with a disambiguation string.
ListModel { ListElement { name: QT_TRANSLATE_NOOP("Context", "Apple", "Apple Comment") // causes "ListElement: cannot use script for property value" run-time error } }
Attached example project reproduces the issue.
Note: The https://doc.qt.io/qt-6/i18n-source-translation.html#qml-use-noop-functions documentation does not include an example of using QT_TR_NOOP with a disambiguation string. If the disambiguation string is to be supported when marking a ListElement string with QT_TR_NOOP, then the documentation may also need to be updated.
Attachments
For Gerrit Dashboard: QTBUG-132684 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
616605,2 | IR Builder: Fix translation binding parsing | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
616721,2 | IR Builder: Fix translation binding parsing | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
617652,2 | IR Builder: Fix translation binding parsing | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
618845,2 | IR Builder: Fix translation binding parsing | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |