How to Translate texts contained in MsgBox in Inno Setup?

為{幸葍}努か 提交于 2019-12-02 06:17:21

问题


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

回答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;


来源:https://stackoverflow.com/questions/23519174/how-to-translate-texts-contained-in-msgbox-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!