Details
-
Task
-
Resolution: Done
-
Not Evaluated
-
None
-
None
-
None
Description
In addition to QTBUG-11859, tooling support is needed in order to specify which translation context should be stored in the .ts file when qsTr() translations are extracted from scripts and QML files. Without this, the developer has to fix-up the .ts file each time it's updated from sources, which is error-prone and a nuisance.
A simple (and sufficient?) solution would be to add a -contextprefix option to lupdate, so that the context can be manually specified when invoking lupdate on a particular qml file (folder/module?). Additional tooling (e.g. .pro file support) could be built on top of that.
Alternatively, the qmldir format could perhaps be extended as follows:
- Add a way to specify something akin to the qmake TRANSLATIONS variable
- Add a way to specify a translation prefix. This should match the path
in which the qmldir file resides, relative to the module root. (It'd be
a similar type of rendundancy to "package foo.bar" in Java...)
And lupdate could be taught to process qmldir files and derive the translation context from there.
Attachments
Issue Links
- is required for
-
QTBUG-11793 QtDeclarative does not handle translations for imported modules
- Closed
- relates to
-
QTBUG-15502 lupdate doesn't recognize TRANSLATOR comments in QtScript files
- Closed