Skip to content

Commit

Permalink
Issue #805: fall back to translated button captions if GetLocaleStrin…
Browse files Browse the repository at this point in the history
…g returned an empty string. Setting an empty button caption raises an exception in TTaskDialogButtonItem
  • Loading branch information
ansgarbecker committed Nov 14, 2019
1 parent 17f6cb8 commit 6695a31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/apphelpers.pas
Expand Up @@ -2367,10 +2367,13 @@ function MessageDialog(const Title, Msg: string; DlgType: TMsgDlgType; Buttons:
cap: String; cap: String;
begin begin
Btn := TTaskDialogButtonItem(Dialog.Buttons.Add); Btn := TTaskDialogButtonItem(Dialog.Buttons.Add);
cap := '';
if ResourceId > 0 then begin if ResourceId > 0 then begin
// Prefer string from user32.dll // Prefer string from user32.dll
// May be empty on Wine!
cap := GetLocaleString(ResourceId) cap := GetLocaleString(ResourceId)
end else begin end;
if cap.IsEmpty then begin
cap := _(BtnCaption); cap := _(BtnCaption);
for i:=1 to Length(cap) do begin for i:=1 to Length(cap) do begin
// Auto apply hotkey // Auto apply hotkey
Expand Down

0 comments on commit 6695a31

Please sign in to comment.