3

I have got a [code] section contained within my inno setup script which displays some information for the user during install. I would like to be able to translate these in the same language the user selected during install. They texts are currently in English and for example want to translate it in Russian, etc. I know I have to do something in the Language.isl file. Below is a example of such text.

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
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
Federico
  • 89
  • 1
  • 8
  • 1
    Use [`custom messages`](http://www.jrsoftware.org/ishelp/index.php?topic=custommessagessection). – TLama May 07 '14 at 13:32
  • 1
    You should create `[CustomMessages]` and then call text like `MsgBox(ExpandConstant('{cm:MyCustomMessage}'), mbInformation, MB_OK);` – RobeN May 07 '14 at 13:34
  • 1
    possible duplicate of [Inno Setup - Change the MessageBox language](http://stackoverflow.com/questions/12989941/inno-setup-change-the-messagebox-language) – TLama May 07 '14 at 13:36
  • Removed unrelated windows-installer tag. – Christopher Painter May 07 '14 at 15:38

1 Answers1

8
[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;
RobeN
  • 5,346
  • 1
  • 33
  • 50