如何将 lupdate 与 @lst-file 参数一起使用?

How to use lupdate with @lst-file argument?

我想 运行 Qt-Linguistlupdate 工具获取 TS 文件列表。我想从文件而不是显式命令参数中给出该列表。

这是命令的帮助:

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.

我想参数 @list-file 正是我需要的,但我不知道如何使用它。我试图提供一个包含我的 TS 文件名称的文件,但出现此错误:

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

我试过 .txt、.lst,没有扩展名。

您缺少帮助文件中显示的“@”。假设您有一个名为 main.qml 的源 QML 文件和一个名为 file.txt 的 lst 文件,其中包含以下行:

lang_de.ts
lang_en.ts
lang_fr.ts

然后你像这样使用 lupdate:

lupdate main.qml -ts @file.txt

它会创建您现在可以在 Linguist 中使用的三个文件。