Tauri 為每種語言配置WiX安裝程序

2023-10-19 17:19 更新

可以為每種語言定義一個配置對象來配置本地化字符串:

{
"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引用以下地區(qū)字符串:LaunchApp、DowngradeErrorMessage、PathEnvVarFeature和InstallAppFeature。您可以定義自己的字符串,并在自定義模板或片段中使用"!(loc.TheStringId)"來引用它們。有關(guān)更多信息,請參閱WiX本地化文檔。


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號