【问题标题】:Qt Installer Framework: Translate component descriptionQt Installer Framework:翻译组件描述
【发布时间】:2016-01-25 18:58:21
【问题描述】:

我已经安装了 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>

所以,长话短说:我如何翻译这个特定的文本行:
&lt;Description&gt;...&lt;/Description&gt;
?

【问题讨论】:

    标签: qt internationalization installation translate qt-installer


    【解决方案1】:

    也许只在 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>
    

    【讨论】:

      【解决方案2】:

      这其实很简单:

      <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>
      

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

      【讨论】:

      • 作为包文件的魅力,但如果用于config.xml,则会导致错误。错误是Caught exception: Error in ./config/config.xml, line 4, column 24: Element 'Name' has been defined before. - 在配置文件中也有办法吗?
      • @Michael 好吧。也许你可以接受这个答案?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-09
      • 1970-01-01
      • 2014-02-18
      • 2017-01-04
      • 2019-11-16
      相关资源
      最近更新 更多