【问题标题】:How to prevent lupdate to remove some entrie from my translation files?如何防止更新从我的翻译文件中删除某些条目?
【发布时间】:2023-01-10 09:28:03
【问题描述】:

我在我的 .ts 文件中添加了一些手动条目,每次运行 lupdate.exe 命令时这些条目都会被删除。

lupdate.exe .. -no-obsolete -locations absolute -ts locale_en.ts locale_fr.ts

我想lupdate.exe 添加缺失的条目,清理过时的条目,但保留手动输入(对应于要翻译的字符串,但翻译是通过函数发生的,而不是直接调用 qsTrqTranslate)。

这可能吗 ?


我的背景:

我在一个没有任何 C 后端、没有任何构建或制作机制的纯 qml 解决方案中。 lupdate.exelrelease.exe 是手动调用的。

【问题讨论】:

    标签: qml translation


    【解决方案1】:

    您可以为名为 additional_locale_fr.ts 的手动条目创建一个额外的翻译源 (TS) 文件,并将其与 lupdate 生成的文件合并,例如locale_fr.ty 使用lconvert

    lconvert -i additional_locale_fr.ts locale_fr.ts -o all_locale_fr.ts
    

    (Merge translation files (.ts) with existing .ts files using QT Utilities (lconvert))

    在这种情况下也很有趣SO

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-13
      • 2012-02-01
      • 1970-01-01
      相关资源
      最近更新 更多