Browse Source

New messages: DownloadingLabel, ButtonStopDownload, StopDownload, ErrorDownloadAborted, ErrorDownloadFailed, ErrorDownloadSizeFailed, ErrorFileHash1, ErrorFileHash2, ErrorProgress, ErrorFileSize.
Todo:
-Now that new mandatory messages are introduced: make currently optional ones mandatory as well.
-Add new view link to whatsnew.
-Update Dutch translation.
-Notify translators.

Martijn Laan 5 years ago
parent
commit
625ed69656
6 changed files with 51 additions and 16 deletions
  1. 12 0
      Files/Default.isl
  2. 9 5
      Projects/Compile.pas
  3. 8 8
      Projects/Install.pas
  4. 10 0
      Projects/MsgIDs.pas
  5. 3 3
      Projects/ScriptDlg.pas
  6. 9 0
      whatsnew.htm

+ 12 - 0
Files/Default.isl

@@ -210,6 +210,18 @@ ReadyMemoComponents=Selected components:
 ReadyMemoGroup=Start Menu folder:
 ReadyMemoTasks=Additional tasks:
 
+; *** TDownloadWizardPage wizard page and DownloadTemporaryFile
+DownloadingLabel=Downloading additional files...
+ButtonStopDownload=&Stop download
+StopDownload=Are you sure you want to stop the download?
+ErrorDownloadAborted=Download aborted
+ErrorDownloadFailed=Download failed: %d %s
+ErrorDownloadSizeFailed=Getting size failed: %d %s
+ErrorFileHash1=File hash failed: %s
+ErrorFileHash2=Invalid file hash: expected %s, found %s
+ErrorProgress=Invalid progress: %d of %d
+ErrorFileSize=Invalid file size: expected %d, found %d
+
 ; *** "Preparing to Install" wizard page
 WizardPreparing=Preparing to Install
 PreparingDesc=Setup is preparing to install [name] on your computer.

+ 9 - 5
Projects/Compile.pas

@@ -7370,10 +7370,14 @@ procedure TSetupCompiler.ReadMessagesFromScript;
     ReadMessagesFromFiles('compiler:Default.isl', LanguageEntries.Count-1);
   end;
 
-const
-  OptionalMessages: set of TSetupMessageID = [msgComponentsDiskSpaceGBLabel, msgDiskSpaceGBLabel, msgPrepareToInstallNeedsRestart,
-    msgFileExistsSelectAction, msgFileExists2, msgFileExistsOverwriteExisting, msgFileExistsKeepExisting, msgFileExistsOverwriteOrKeepAll,
-    msgExistingFileNewerSelectAction, msgExistingFileNewer2, msgExistingFileNewerOverwriteExisting, msgExistingFileNewerKeepExisting, msgExistingFileNewerOverwriteOrKeepAll];
+  function IsOptional(const MessageID: TSetupMessageID): Boolean;
+  begin
+    Result := MessageID in [msgComponentsDiskSpaceGBLabel, msgDiskSpaceGBLabel, msgPrepareToInstallNeedsRestart,
+      msgFileExistsSelectAction, msgFileExists2, msgFileExistsOverwriteExisting, msgFileExistsKeepExisting,
+      msgFileExistsOverwriteOrKeepAll, msgExistingFileNewerSelectAction, msgExistingFileNewer2,
+      msgExistingFileNewerOverwriteExisting, msgExistingFileNewerKeepExisting, msgExistingFileNewerOverwriteOrKeepAll];
+  end;
+
 var
   I: Integer;
   LangData: TLangData;
@@ -7399,7 +7403,7 @@ begin
   for I := 0 to LanguageEntries.Count-1 do begin
     LangData := LangDataList[I];
     for J := Low(LangData.Messages) to High(LangData.Messages) do
-      if not LangData.MessagesDefined[J] and not (J in OptionalMessages) then begin
+      if not LangData.MessagesDefined[J] and not IsOptional(J) then begin
         { Use the message from Default.isl }
         if not (J in [msgHelpTextNote, msgTranslatorNote]) then
           WarningsList.Add(Format(SCompilerMessagesMissingMessageWarning,

+ 8 - 8
Projects/Install.pas

@@ -3557,7 +3557,7 @@ begin
     { Create temporary file }
     TempFile := GenerateUniqueName(DisableFsRedir, PathExtractPath(DestFile), '.tmp');
     if not DisableFsRedirectionIf(DisableFsRedir, PrevState) then
-      raise Exception.Create('DisableFsRedirectionIf failed');
+      InternalError('DisableFsRedirectionIf failed');
     try
       TempF := TFileStream.Create(TempFile, fmCreate);
       TempFileLeftOver := True;
@@ -3575,9 +3575,9 @@ begin
     { Download to temporary file}
     HTTPResponse := HTTPClient.Get(Url, TempF);
     if HTTPDataReceiver.Aborted then
-      raise Exception.Create('Download aborted')
+      raise Exception.Create(SetupMessages[msgErrorDownloadAborted])
     else if (HTTPResponse.StatusCode < 200) or (HTTPResponse.StatusCode > 299) then
-      raise Exception.CreateFmt('Download failed: %d %s', [HTTPResponse.StatusCode, HTTPResponse.StatusText])
+      raise Exception.CreateFmt(SetupMessages[msgErrorDownloadFailed], [HTTPResponse.StatusCode, HTTPResponse.StatusText])
     else begin
       { Download completed, get temporary file size and close it }
       Result := TempF.Size;
@@ -3588,15 +3588,15 @@ begin
         try
           SHA256OfFile := GetSHA256OfFile(DisableFsRedir, TempFile);
         except on E: Exception do
-          raise Exception.CreateFmt('File hash failed: %s', [E.Message]);
+          raise Exception.CreateFmt(SetupMessages[msgErrorFileHash1], [E.Message]);
         end;
         if RequiredSHA256OfFile <> SHA256OfFile then
-          raise Exception.CreateFmt('Invalid file hash: expected %s, found %s', [RequiredSHA256OfFile, SHA256OfFile]);
+          raise Exception.CreateFmt(SetupMessages[msgErrorFileHash2], [RequiredSHA256OfFile, SHA256OfFile]);
       end else begin
         if HTTPDataReceiver.Progress <> HTTPDataReceiver.ProgressMax then
-          raise Exception.CreateFmt('Invalid progress: %d of %d', [HTTPDataReceiver.Progress, HTTPDataReceiver.ProgressMax])
+          raise Exception.CreateFmt(SetupMessages[msgErrorProgress], [HTTPDataReceiver.Progress, HTTPDataReceiver.ProgressMax])
         else if HTTPDataReceiver.ProgressMax <> Result then
-          raise Exception.CreateFmt('Invalid file size: expected %d, found %d', [HTTPDataReceiver.ProgressMax, Result]);
+          raise Exception.CreateFmt(SetupMessages[msgErrorFileSize], [HTTPDataReceiver.ProgressMax, Result]);
       end;
 
       { Rename the temporary file to the new name now, with retries if needed }
@@ -3643,7 +3643,7 @@ begin
     SetSecureProtocols(HTTPClient);
     HTTPResponse := HTTPClient.Head(Url);
     if (HTTPResponse.StatusCode < 200) or (HTTPResponse.StatusCode > 299) then
-      raise Exception.CreateFmt('Getting size failed: %d %s', [HTTPResponse.StatusCode, HTTPResponse.StatusText])
+      raise Exception.CreateFmt(SetupMessages[msgErrorDownloadSizeFailed], [HTTPResponse.StatusCode, HTTPResponse.StatusText])
     else
       Result := HTTPResponse.ContentLength; { Could be -1 }
   finally

+ 10 - 0
Projects/MsgIDs.pas

@@ -42,6 +42,7 @@ type
     msgButtonNo,
     msgButtonNoToAll,
     msgButtonOK,
+    msgButtonStopDownload,
     msgButtonWizardBrowse,
     msgButtonYes,
     msgButtonYesToAll,
@@ -72,18 +73,26 @@ type
     msgDiskSpaceWarning,
     msgDiskSpaceWarningTitle,
     msgDontCloseApplications,
+    msgDownloadingLabel,
     msgErrorChangingAttr,
     msgErrorCloseApplications,
     msgErrorCopying,
     msgErrorCreatingDir,
     msgErrorCreatingTemp,
+    msgErrorDownloadAborted,
+    msgErrorDownloadFailed,
+    msgErrorDownloadSizeFailed,
     msgErrorExecutingProgram,
+    msgErrorFileHash1,
+    msgErrorFileHash2,
+    msgErrorFileSize,
     msgErrorFunctionFailed,
     msgErrorFunctionFailedNoCode,
     msgErrorFunctionFailedWithMessage,
     msgErrorIniEntry,
     msgErrorInternal2,
     msgErrorOpeningReadme,
+    msgErrorProgress,
     msgErrorReadingExistingDest,
     msgErrorReadingSource,
     msgErrorRegCreateKey,
@@ -224,6 +233,7 @@ type
     msgStatusSavingUninstall,
     msgStatusRunProgram,
     msgStatusUninstalling,
+    msgStopDownload,
     msgTranslatorNote,
     msgUninstallAppFullTitle,
     msgUninstallAppTitle,

+ 3 - 3
Projects/ScriptDlg.pas

@@ -893,7 +893,7 @@ type
 
 procedure TDownloadWizardPage.AbortButtonClick(Sender: TObject);
 begin
-  FNeedToAbortDownload := LoggedMsgBox('Are you sure you want to stop the download?', '', mbConfirmation, MB_YESNO, True, ID_YES) = IDYES;
+  FNeedToAbortDownload := LoggedMsgBox(SetupMessages[msgStopDownload], '', mbConfirmation, MB_YESNO, True, ID_YES) = IDYES;
 end;
 
 function TDownloadWizardPage.InternalOnDownloadProgress(const Url, BaseName: string; const Progress, ProgressMax: Int64): Boolean;
@@ -942,11 +942,11 @@ procedure TDownloadWizardPage.Initialize;
 begin
   inherited;
 
-  FMsg1Label.Caption := 'Downloading additional files...';
+  FMsg1Label.Caption := SetupMessages[msgDownloadingLabel];
 
   FAbortButton := TNewButton.Create(Self);
   with FAbortButton do begin
-    Caption := '&Stop download';
+    Caption := SetupMessages[msgButtonStopDownload];
     Top := FProgressBar.Top + FProgressBar.Height + WizardForm.ScalePixelsY(8);
     Width := WizardForm.CalculateButtonWidth([Caption]);
     Anchors := [akLeft, akTop];

+ 9 - 0
whatsnew.htm

@@ -100,6 +100,15 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
 
 <p>Contributions via <a href="https://github.com/jrsoftware/issrc" target="_blank">GitHub</a>: <b>Thanks to Gavin Lambert and leserg73 for their contributions.</b></p>
 
+<p>Some messages have been added and changed in this version: (<a href=" todo ">View differences in Default.isl</a>).</p>
+<ul>
+  <li><b>New messages:</b> DownloadingLabel, ButtonStopDownload, StopDownload, ErrorDownloadAborted, ErrorDownloadFailed, ErrorDownloadSizeFailed, ErrorFileHash1, ErrorFileHash2, ErrorProgress, ErrorFileSize.</li>
+<!--   <li><b>Changed message:</b> SelectLanguageLabel.</li> -->
+<!--   <li><b>Removed messages:</b> EntryAbortRetryIgnore, ExistingFileReadOnly, ExistingFileReadOnlyAbortRetryIgnore, FileAbortRetryIgnore, FileAbortRetryIgnore2, MissingWOW64APIs.</li> -->
+</ul>
+
+<p>Note: Not all official translations have been updated for these changes at this moment. <!-- Demoted the official <a href="https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/German.isl">German</a>, <a href="https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Nepali.islu">Nepali</a>, <a href="https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/SerbianCyrillic.isl">Serbian (Cyrillic)</a> and <a href="https://raw.github.com/jrsoftware/issrc/main/Files/Languages/Unofficial/SerbianLatin.isl">Serbian (Latin)</a> translations to unofficial because of a no longer available maintainer. To send updates yourself, see <a href="http://news.jrsoftware.org/read/article.php?id=2514&amp;group=jrsoftware.innosetup.translations#2514">this post</a> for what needs updating and use <a href="https://jrsoftware.org/files/istrans/send2.php">this form</a> to send updates (or use <a href="https://github.com/jrsoftware/issrc" target="_blank">GitHub</a>). See the <a href="https://jrsoftware.org/files/istrans/">Inno Setup Translations</a> page for more information. --></li>
+
 <p><a href="https://jrsoftware.org/files/is6.0-whatsnew.htm">Inno Setup 6.0 Revision History</a></p >
 
 </body>