cho*_*wey 4 inno-setup internationalization
如何在Inno Setup中使用内置消息?
在"Default.isl"中有一条消息"FullInstallation",我想在我的Inno Setup脚本中使用它.因此,此消息已经被Inno Setup支持的所有语言翻译.它可以使我免于为此文本自己做翻译.
我看到"Default.isl"有一个[CustomMessages]部分,我可以使用它们(例如){cm:CreateDesktopIcon}(因为"CreateDesktopIcon"作为自定义消息存在).
如何使用本[CustomMessages]节未列出的其他消息之一?
据我所知,{cm:...}你可以扩展一个[Messages]条目.如果我是对的,那么这取决于你想在哪里使用这样的常数.如果它在脚本部分中,那么你需要使用scripted constant带有getter调用SetupMessage函数的函数,通过它可以扩展所选语言的内置消息this file.
您可以注意到,每个消息常量只包含语言文件中条目的msg前缀[Messages].
例如,要将WizardPreparing消息扩展Description为[Run]节条目的值,您可以通过msgWizardPreparing以下方式展开常量:
[Run]
Filename: "MyProg.exe"; Description: "{code:GetDescription}"
[Code]
function GetDescription(Value: string): string;
begin
Result := SetupMessage(msgWizardPreparing);
end;
Run Code Online (Sandbox Code Playgroud)
在该[Code]部分中,情况自然更容易,因为SetupMessage您可以直接在那里使用该功能.因此,例如,要显示带有展开CannotContinue消息的消息框,您msgCannotContinue只需这样扩展常量:
[Code]
procedure InitializeWizard;
var
S: string;
begin
S := SetupMessage(msgCannotContinue);
MsgBox(S, mbInformation, MB_OK);
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1930 次 |
| 最近记录: |