[Qt-creator] Running lupdate from Qt Creator

Harri Pasanen harri at mpaja.com
Sat Jan 3 19:31:06 CET 2015


I suppose this is only tangentially related to Qt Creator, but since 
there is Tools/Options/Environment/External Tools/Linguist dialog, 
perhaps someone knows.

My project has bunch of c++ and *.h files and many qml files in a qml 
subdirectory.

All the QML is pulled into the project via a resource file, the 
following line in the .pro:

RESOURCES += qml.qrc

And the following line is for translations:

TRANSLATIONS = stoppola_fi.ts

Now the Linguist/Update Translations (lupdate) in settings
seems the have the following defaults:

Executable: %{CurrentProject:QT_INSTALL_BINS}/lupdate
Arguments: %{CurrentProject:FilePath}
Working directory: %{CurrentProject:Path}

I guess the CurrentProject:FilePath refers to the .pro file

If I run lupdate from Tools/External/Linguist/Update Translations
the stoppola_fi.ts is generated, but all the qml files are missing from it.

Now my question is, how do I add the qml files?

I tried from command line things like

lupdate Stoppola.ts -I qml

lupdate -ts stoppola_fi.ts -I qml

lupdate -ts stoppola_fi.ts *.cpp qml/*.qml

None of which worked, although my reading of "lupdate -help" gave me hope
that those would work.

I got following kinds of errors:

lupdate Stoppola.ts -I qml
lupdate error: Both project and source files / include paths specified.

lupdate -ts stoppola_fi.ts -I qml
Updating 'stoppola_fi.ts'...
     Found 0 source text(s) (0 new and 0 already existing)

lupdate -ts stoppola_fi.ts *.cpp qml/*.qml
lupdate error: File 'audiolist.cpp' has no recognized extension.

Are these bugs, what at least some look like to me,
or just poor documentation?

Ideally the default parameters should handle the qrc included qml, but
even dropping to command line did not help in this case.

Now about to try the @lst-file option...

Harri






More information about the Qt-creator mailing list