Inno Setup - 更改MessageBox语言

4

我有一个问题... 我做了一个个人消息框... 我用英语和西班牙语非常幽默的方式表达... 但我希望我的安装程序只显示一种语言... 就像... 当我在菜单选择器中选择西班牙语时... 那个消息框就会显示西班牙语... 如果我选择意大利语在菜单选择器中... 让那个消息框显示意大利语。

[code]
function NextButtonClick1(PageId: Integer): Boolean;
begin
    Result := True;
    if (PageId = wpSelectDir) and not FileExists(ExpandConstant('{app}\xxx.exe')) then begin
        MsgBox('"Thi App" does not seem to be installed in that folder.  Please select the correct folder. [Selecciona la Carpeta de Instalación de la Aplicación]', mbError, MB_OK);
        Result := False;
        exit;
    end;
end;
1个回答

7
使用[CustomMessages]部分,并在其中使用语言的内部名称为message名称添加前缀,如下所示的脚本:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=userdocs:Inno Setup Examples Output

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"
Name: es; MessagesFile: "compiler:Languages\Spanish.isl"

[CustomMessages]
en.AppCheckError=Select the application folder!
es.AppCheckError=Selecciona la Carpeta de Instalación de la Aplicación!

[Code]
procedure InitializeWizard;
begin
  MsgBox(ExpandConstant('{cm:AppCheckError}'), mbInformation, MB_OK);
end;

非常感谢你,你在这方面很擅长。我觉得应该在我的安装程序中给你鸣谢XD。 - Dielo
2
请注意,消息框中的按钮将始终显示为用户界面语言,而不管他们选择了哪种语言进行安装。(这只是Windows的工作方式。) - Miral
是啊,我正在学习呢。我已经很久没有碰过这些代码了。非常感谢。 - Dielo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接