Qt安装程序框架:翻译组件描述

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Qt安装程序框架:翻译组件描述相关的知识,希望对你有一定的参考价值。

我已经安装了Qt Installer Framework QtIFW2.0.1,我看了一下这些已经发布的示例。 当我仔细查看示例翻译时,我学会了如何翻译自定义ui文件的内容。但是我在示例和文档中都没有看到我如何翻译位于组件package.xml文件中的文本。 在上面提到的例子中,这看起来像这样:

<?xml version="1.0" encoding="UTF-8"?> <Package> <DisplayName>The root component</DisplayName> <Description>This component contains a license and translations to German.</Description> <Version>0.5.0-1</Version> <ReleaseDate>2015-01-29</ReleaseDate> <Licenses> <License name="Beer Public License Agreement" file="license.txt" /> </Licenses> <Default>true</Default> <Script>installscript.qs</Script> <UserInterfaces> <UserInterface>page.ui</UserInterface> </UserInterfaces> <Translations> <Translation>de.qm</Translation> <Translation>pl.qm</Translation> </Translations> </Package>

所以,长话短说:我如何翻译这个特定的文本行: <Description>...</Description>

答案

这实际上非常简单:

<Description>Miam-Player is the main program. It is required and cannot be unselected.</Description>
<Description xml:lang="fr_fr">Miam-Player est le programme principal. Il est requis et ne peut être désélectionné.</Description>

我认为你不需要别的东西。

另一答案

也许只在IFW 3.0中,但在我的情况下它起作用了。

要指定“DisplayName”的本地化,您需要使用5个字符的语言名称,对于“Desctiption”,您需要使用2个字母的语言名称

<DisplayName>The root component</DisplayName>
<DisplayName xml:lang="ru_RU">Корневой компонент</DisplayName>
<Description>Miam-Player is the main program. It is required and cannot be unselected.</Description>
<Description xml:lang="ru">Miam-Player это основная программа. Она необходима и не может быть отменена</Description>

以上是关于Qt安装程序框架:翻译组件描述的主要内容,如果未能解决你的问题,请参考以下文章

Qt Quick 不翻译通过 Loader 加载的组件

使用 Qt 安装程序框架脚本记录控制台输出

qt lrelease windows 二进制文件?

26.Qt Quick QML-RotationAnimationPathAnimationSmoothedAnimationBehaviorPauseAnimationSequential(代码片段

Qt-QMake官方使用手册(翻译)

Qt应用程序开发框架-快速入门篇