Details
-
Suggestion
-
Resolution: Fixed
-
P2: Important
-
6.5.0
-
None
-
704cb9e29 (dev), d6e0d5630 (dev), d7745594b (dev), 8469be276 (dev), a1f82b34b (dev), 6599fd644 (dev), faa49d960 (dev)
Description
By default qsTr uses the qml file name as the context. When a different context is desired, it needs to be spelled out for each translatable string with qsTranslate, which is cumbersome if all translatable strings in a qml files should use the same, different context.
It would be good if there was an easier way to specify the translation context for the whole file, so one could specify it once, and then just use qsTr("mystring") throughout the file.
This must be both understood by linguist/lupdate and at runtime by qsTr. It probably could be a pragma or specific attribute/property of the item.
Attachments
For Gerrit Dashboard: QTBUG-114528 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
510793,21 | Add pragma syntax to support translation context | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
511760,4 | lupdate: Add using pragma to control translation context in qml file | dev | qt/qttools | Status: MERGED | +2 | 0 |
512008,3 | Add documentation about new translation context pragma in QML | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
513834,5 | Add documentation for Translator pragma | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
514260,5 | Update documentation about new translation context pragma in QML | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
516851,3 | Allow pragma Translator to have a string literal as value | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
516854,2 | Update pragma Translator documentation | dev | qt/qtdoc | Status: MERGED | +2 | 0 |