Internationalization 在Inno设置中使用内置消息
如何在Inno设置中使用内置消息 在“Default.isl”中有一条消息“FullInstallation”,我想在Inno安装脚本中使用它。因此,此消息已翻译成Inno Setup支持的所有语言。这样我就不用自己翻译这篇文章了 我看到“Default.isl”有一个Internationalization 在Inno设置中使用内置消息,internationalization,inno-setup,Internationalization,Inno Setup,如何在Inno设置中使用内置消息 在“Default.isl”中有一条消息“FullInstallation”,我想在Inno安装脚本中使用它。因此,此消息已翻译成Inno Setup支持的所有语言。这样我就不用自己翻译这篇文章了 我看到“Default.isl”有一个[CustomMessages]部分,我可以使用(例如){cm:CreateDesktopIcon}(因为“CreateDesktopIcon”作为自定义消息存在) 如何使用[CustomMessages]部分中未列出的其他消息之
[CustomMessages]
部分,我可以使用(例如){cm:CreateDesktopIcon}
(因为“CreateDesktopIcon”作为自定义消息存在)
如何使用
[CustomMessages]
部分中未列出的其他消息之一?据我所知,没有类似的常数可用于展开条目。如果我是对的,那么这取决于你想在哪里使用这个常数。如果在脚本部分,那么您需要使用一个带有getter的函数来调用该函数,通过该函数,您可以通过中列出的常量来扩展所选语言的内置消息
正如您所注意到的,每个消息常量都只有来自语言文件的条目的msg
前缀
例如,要将向导preparing
消息展开为[Run]
部分条目的值,您可以通过以下方式展开msgWizardPreparing
常量:
[Run]
Filename: "MyProg.exe"; Description: "{code:GetDescription}"
[Code]
function GetDescription(Value: string): string;
begin
Result := SetupMessage(msgWizardPreparing);
end;
[Code]
procedure InitializeWizard;
var
S: string;
begin
S := SetupMessage(msgCannotContinue);
MsgBox(S, mbInformation, MB_OK);
end;
在[code]
部分中,情况自然更容易,因为您可以直接在那里使用该函数。因此,例如,要显示带有扩展的CannotContinue
消息的消息框,您只需通过以下方式扩展msgCannotContinue
常量:
[Run]
Filename: "MyProg.exe"; Description: "{code:GetDescription}"
[Code]
function GetDescription(Value: string): string;
begin
Result := SetupMessage(msgWizardPreparing);
end;
[Code]
procedure InitializeWizard;
var
S: string;
begin
S := SetupMessage(msgCannotContinue);
MsgBox(S, mbInformation, MB_OK);
end;
我试图在脚本部分使用它,但是如果没有直接的方法,这是一个很好的解决方案。我想说,这不会有任何常数,因为这些消息的目的主要是为了内部使用。