diff --git a/source/apphelpers.pas b/source/apphelpers.pas index ce9e0bc7..4939fd1f 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -2665,9 +2665,19 @@ end; function f_(const Pattern: string; const Args: array of const): string; +var + TranslatedPattern: String; begin // Helper for translation, replacement for Format(_()) - Result := Format(_(Pattern), Args); + try + TranslatedPattern := _(Pattern); + Result := Format(TranslatedPattern+' %s %d', Args); + except + on E:Exception do begin + MainForm.LogSQL(E.ClassName+' in translation string with invalid format arguments: "'+TranslatedPattern+'"', lcError); + Result := Format(Pattern, Args); + end; + end; end; diff --git a/source/main.pas b/source/main.pas index 5f6ac0b8..194ab386 100644 --- a/source/main.pas +++ b/source/main.pas @@ -7062,8 +7062,8 @@ begin // Paint error line with red background Edit := Sender as TSynMemo; LineText := Copy(Edit.Lines[Line-1], 1, 100); - Search := f_(MsgSQLError, [-1, '']); - Search := Copy(Search, 1, Pos('-1', Search)-1); + Search := _(MsgSQLError); + Search := Copy(Search, 1, Pos('%', Search)-1); //Logsql(LineText+' ::: '+Search); if LineText.Contains(Search) then begin Special := True;