qtqt-linguist

How to use lupdate with @lst-file argument?


I want to run the lupdate tool of Qt-Linguist for a list of TS files. I want to give that list from a file and not from explicit command arguments.

This is the help of the command :

Usage:

lupdate [options] [project-file]...
lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file
@lst-file
     Read additional file names (one per line) or includepaths (one per
     line, and prefixed with -I) from lst-file.

I GUESS the argument @list-file is exactly what I need but I do not know how to use it. I tried to give a file containing the names of my TS files but I get this error :

 $ lupdate.exe source -ts translations/language-list.txt
 Scanning directory 'source'...
 lupdate error: File 'translations/language-list.txt' has no recognized extension.

I tried with .txt, .lst, no extension.


Solution

  • You are missing the "@" as shown in the help file. Assuming as an example you have a source QML file called main.qml and an lst-file called file.txt which contains these lines:

    lang_de.ts
    lang_en.ts
    lang_fr.ts
    

    Then you use lupdate like this:

    lupdate main.qml -ts @file.txt
    

    And it will create the three files which you can now use in Linguist.