Tauri 为每种语言配置WiX安装程序
可以为每种语言定义一个配置对象来配置本地化字符串:
{
"tauri": {
"bundle": {
"windows": {
"wix": {
"language": {
"en-US": null,
"pt-BR": {
"localePath": "./wix/locales/pt-BR.wxl"
}
}
}
}
}
}
}
localePath
属性定义了语言文件的路径,即配置语言文化的XML文件:
<WixLocalization
Culture="en-US"
xmlns="http://schemas.microsoft.com/wix/2006/localization"
>
<String Id="LaunchApp"> Launch MyApplicationName </String>
<String Id="DowngradeErrorMessage">
A newer version of MyApplicationName is already installed.
</String>
<String Id="PathEnvVarFeature">
Add the install location of the MyApplicationName executable to
the PATH system environment variable. This allows the
MyApplicationName executable to be called from any location.
</String>
<String Id="InstallAppFeature">
Installs MyApplicationName.
</String>
</WixLocalization>
备注
WiXLocalization元素的Culture字段必须与配置的语言匹配。
目前,Tauri引用以下地区字符串:LaunchApp、DowngradeErrorMessage、PathEnvVarFeature和InstallAppFeature。您可以定义自己的字符串,并在自定义模板或片段中使用"!(loc.TheStringId)"来引用它们。有关更多信息,请参阅WiX本地化文档。