【问题标题】:How to Translate texts contained in MsgBox in Inno Setup?如何在 Inno Setup 中翻译 MsgBox 中包含的文本?
【发布时间】:2014-05-07 13:26:41
【问题描述】:

我的 inno 安装脚本中包含一个 [code] 部分,它在安装期间为用户显示一些信息。我希望能够以用户在安装期间选择的相同语言翻译这些内容。他们的文本目前是英文的,例如想要翻译成俄文等。我知道我必须在 Language.isl 文件中做一些事情。以下是此类文本的示例。

if MsgBox('Previous program found. It is recommendeded to uninstall it and install a fresh program. Please note that your data will not be deleted during the uninstallation. Do you want to continue?', mbConfirmation, MB_YESNO) = IDYES then
      begin etc

【问题讨论】:

  • 使用custom messages
  • 你应该创建[CustomMessages],然后调用像MsgBox(ExpandConstant('{cm:MyCustomMessage}'), mbInformation, MB_OK);这样的文本
  • 谢谢你们,马上试试这个!
  • 删除了不相关的 windows-installer 标签。

标签: installation translation inno-setup pascalscript


【解决方案1】:
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"

[CustomMessages]
CustomMessage=Undefined //just in case (should be equal to English)
english.CustomMessage=English Selected
german.CustomMessage=German Selected
polish.CustomMessage=Polish Selected

[Code]
function InitializeSetup: Boolean;
begin
  Result := True;  
  MsgBox(ExpandConstant('{cm:CustomMessage}'), mbInformation, MB_OK);
end;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-08
    • 2017-04-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多