You can generate the translation file by executing lupdatein the QML file:
lupdate main.qml -ts main.ts
To get the .ts file by running lupdatethe .pro project file, you can use a workaround. From the Qt documentation:
lupdate . lupdate .pro . . , SOURCES HEADERS .pro . , .
SOURCES ++. QML JavaScript , ++. lupdate_only {...} , lupdate .qml, ++ .
.qml , :
lupdate_only{
SOURCES = content/main.qml
}
lupdate .pro, .ts QML.
, , , ,
lupdate_only
{
SOURCES = content/main.qml
}
( , OS X 10.12/Qt 5.7) , , - , .
clang: warning: <qml source file>: 'linker' input unused
clang: warning: argument unused during compilation: '-g'
clang: warning: argument unused during compilation: '-isysroot /Applications/Xcode_7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'
...
clang: error: no such file or directory: 'Page1.o'
clang: error: no such file or directory: 'Page1Form.ui.o'
:
lupdate_only \
{
SOURCES = content/main.qml
}