【发布时间】:2020-02-18 09:31:34
【问题描述】:
在我阅读的Qt lrelease tool 的文档中,可以使用以下命令将.ts 文件编译为.qm 二进制文件:
lrelease.exe main_en.ts languages\main_fr.ts
是否可以使用.xliff 文件以及输入而不是.ts 文件来将.xliff 文件编译为.qm 文件?是怎么做到的?
【问题讨论】:
标签: qt qt-linguist
在我阅读的Qt lrelease tool 的文档中,可以使用以下命令将.ts 文件编译为.qm 二进制文件:
lrelease.exe main_en.ts languages\main_fr.ts
是否可以使用.xliff 文件以及输入而不是.ts 文件来将.xliff 文件编译为.qm 文件?是怎么做到的?
【问题讨论】:
标签: qt qt-linguist
从documentation of lupdate 中提到可以从XLIFF 文件生成.ts 文件。然后您可以使用lrelease 生成.qm 文件。
请注意,仅支持 XLIFF 1.1 格式,不支持 1.0。
【讨论】:
.xlf 文件调用它时,它没有给我一个 .ts 文件,就像下面的 lupdate E:\Users\<User>\Desktop\<.xlf file> 或 lupdate -ts E:\Users\<User>\Desktop\<.xlf file> 我做错了什么?
xlf文件的样本来做一些测试吗?
.xlf 文件@FrankOsterfeld 所以 lupdate 不能在这些文件类型之间正确转换?
要将 xliff 文件转换为 ts,您可以使用带有如下命令行的 lconvert 实用程序:
lconvert -o converted.ts -i original.xlf
这是lconvert -help的输出:
用法: lconvert [选项] [...]
lconvert 是 Qt 语言学家工具链的一部分。它可以用作 用于转换和过滤翻译数据文件的独立工具。这 支持以下文件格式:
qm - Compiled Qt translations pot - GNU Gettext localization template files ts11 - Qt translation sources (format 1.1) ts20 - Qt translation sources (format 2.0) qph - Qt Linguist 'Phrase Book' ts - Qt translation sources (latest format) po - GNU Gettext localization files xlf - XLIFF localization files如果指定了多个输入文件,则将它们与 以后文件的翻译优先。
选项: -H --help 显示此信息并退出。
-i <infile> --input-file <infile> Specify input file. Use if <infile> might start with a dash. This option can be used several times to merge inputs. May be '-' (standard input) for use in a pipe. -o <outfile> --output-file <outfile>
更多关于这个 Qt 工具的信息here
【讨论】: