Localization 无法本地化wix internall字符串

Localization 无法本地化wix internall字符串,localization,internationalization,wix,Localization,Internationalization,Wix,Wix I18n Dev.wixtoolset的版本是V3.7。 安装程序UI由UIExtension创建。 在安装过程中,有些UI字符串无法本地化。例如“复制新文件”等等。我搜索了这些字符串,在wix源代码(wix37 sources\src\ext\UIExtension\wixlib\WixUI_en-us.wxl)中找到了这些字符串,wix已经对这些字符串进行了本地化。 wix已经本地化了这些字符串,但在安装过程中仍然显示为英语,这让我很困惑。即使我替换了.wxl文件中的这些字符串,它仍

Wix I18n Dev.wixtoolset的版本是V3.7。 安装程序UI由UIExtension创建。 在安装过程中,有些UI字符串无法本地化。例如“复制新文件”等等。我搜索了这些字符串,在wix源代码(wix37 sources\src\ext\UIExtension\wixlib\WixUI_en-us.wxl)中找到了这些字符串,wix已经对这些字符串进行了本地化。 wix已经本地化了这些字符串,但在安装过程中仍然显示为英语,这让我很困惑。即使我替换了.wxl文件中的这些字符串,它仍然显示为英文字符串。


我尝试了BdN3504的例子。 wxs文件与BdN3504相同。 wxl文件是

而且你可以看到现在的状态仍然是保持英语。


我的构建环境是VS2010和wix3.7。我不知道有什么问题……

我已经回答了这个问题

阅读这篇文章,或者查看Nick Ramirez书中名为
进度条消息的段落

packtpublishing的好人在这里免费提供他书中包含该段落的章节:

。见第329页

另一个有趣的页面是这篇MSDN文章:书中也提到了这篇文章

编辑:由于这些评论,我将发布一个有效的示例和一个屏幕截图,因此您可以看到它是有效的:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="LocalizingErrors" Language="1034" Version="1.0.0.0" Manufacturer="SomeOne" UpgradeCode="7ddbcad4-98d9-4c2d-9ae6-6fdc47314947">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MediaTemplate EmbedCab="no" />

        <Feature Id="ProductFeature" Title="LocalizingErrors" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>

    <!-- Custom Progress messages

    Custom progress messages are defined by a table in the MSI called ActionText. However, by default
    this table isn't included. Without it, the messages are the stock English versions.

    To add the ActionText table with strings for progress messages, add a ProgressText element inside
    a UI element for each standard action found in the Execute sequence. For example, to add a 
    localized message for the InstallFiles action, add the following markup to one of your wxs files:
    -->
    <UI>
      <ProgressText Action="InstallFiles" Template="!(loc.InstallFilesTemplate)">!(loc.InstallFiles)</ProgressText>
      <ProgressText Action="CreateShortcuts" Template="!(loc.CreateShortcutsTemplate)">!(loc.CreateShortcuts)</ProgressText>
      <ProgressText Action="WriteRegistryValues" Template="!(loc.WriteRegistryValuesTemplate)">!(loc.WriteRegistryValues)</ProgressText>
      <ProgressText Action="RegisterUser" Template="!(loc.RegisterUserTemplate)">!(loc.WriteRegistryValues)</ProgressText>
      <ProgressText Action="RegisterProduct" Template="!(loc.RegisterProductTemplate)">!(loc.RegisterProduct)</ProgressText>
      <ProgressText Action="PublishFeatures" Template="!(loc.PublishFeaturesTemplate)">!(loc.PublishFeatures)</ProgressText>
      <ProgressText Action="PublishProduct" Template="!(loc.PublishProductTemplate)">!(loc.PublishFeatures)</ProgressText>
      <ProgressText Action="InstallFinalize" Template="!(loc.InstallFinalizeTemplate)">!(loc.InstallFinalize)</ProgressText>
    </UI>
    <UIRef Id="WixUI_Minimal"/>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="LocalizingErrors" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="ProductComponent" Guid="92A175A0-D15D-48EC-B2E1-FD5848FB6430">
        <File Id="somefile" Source="..\File.exe" KeyPath="yes" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>
最后是一个屏幕截图,向您展示它的工作原理:

另一种编辑:要本地化错误字符串,只需定义带有相应错误号的
error
元素:

<UI>
    <Error Id="1322">Una parte de la ruta de la carpeta no es válido. Se está vacío o supera la longitud permitida por el sistema.</Error>
    <Error Id="1311">!(loc.Error_1311)</Error>
</UI>

在瓦里多的地毯上走一段路。这是一个长期的许可证制度。
!(位置错误_1311)

第一个错误字符串是硬编码的,所以这不是一个好的解决方案。最好使用本地化文件,因为这是在第二个
错误
元素中完成的。

非常感谢BdN3504。你帮我解决了另一个问题。include WixUI_ErrorProgressText可以本地化错误消息。但是我的安装界面上的字符串不是错误消息,你可以从图片中看到。和“第12章:本地化你的安装程序。参见第329页。”不起作用。我想知道这是否是wix3.7的bug。。。很高兴我能帮忙。请看我在上面的答案中链接的帖子。它准确地描述了为标准操作设置本地化字符串所必须执行的操作。如果你愿意,我可以复制答案并在这里编辑我的答案。但我认为这会导致冗余,这应该在stackoverflow上避免。旁注:如果你觉得我的帖子很有用,请把它投上去感谢我。我能理解你的逻辑,看起来还可以。但您的示例在我的环境中运行的方式不同,这让我非常困惑。“复制新文件”的状态似乎不能为L10n。请看我在问题面板上的例子。你做错了。Wix不会为你翻译文本,你必须自己翻译。我将用您的示例演示:要翻译复制新文件,您不需要编写
[CN]复制新文件[CN]
。你必须自己翻译这个字符串(我不懂中文,但我用谷歌翻译):
复制新文件
<UI>
    <Error Id="1322">Una parte de la ruta de la carpeta no es válido. Se está vacío o supera la longitud permitida por el sistema.</Error>
    <Error Id="1311">!(loc.Error_1311)</Error>
</UI>