0

I could translate the Captions[] and ButtonCaptions[] used by MessageDlg if I set the appropriate constants in the Vcl.Consts.pas. But as I can see there is no such an easy solution like this for TOpenDialog and TSaveDialog. These are Windows controls and something more tricky solution needed. I tried the FindComponent on the created dialog and the fFileDialog in the created wrapper (during the Execute call). But the debugger says : the ComponentCount is 0 for both components.

How could I translate these dialogs?

It is not a problem to modify the Vcl.Dialogs.pas because my program uses a copy of this (I had to modify it yet for another reasons)

SOLID Developper
  • 672
  • 4
  • 12
  • Use `TFileOpenDialog` and `TFileSaveDialog`. – Andreas Rejbrand Mar 28 '23 at 11:47
  • @AndreasRejbrand It looks a half solution. There are properties for `Title` and `OKButtonLabel` but what about the `Cancel` button? The `dlg.Dialog : IFileDialog` does not define a method to set it. – SOLID Developper Mar 28 '23 at 12:12
  • You are displaying dialogs that are provided by the OS, not the VCL. So, they are already localized by the OS to the user's locale. If you need to change that, you will have to manipulate the dialogs at the Win32 API layer. Look at [`IFileDialogCustomize.SetControlLabel()`](https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialogcustomize-setcontrollabel), for instance. – Remy Lebeau Mar 28 '23 at 15:42

0 Answers0