ShortCutToText uses the MenuKeyCaps array. This cannot be changed directly (because it is in the implementation of the Menus block), but the array is filled with resourcestrings , which can be translated using various translation tools.
You need to translate the constant constant SmkcCtrl, which is located in consts.pas (depending on the version of Delphi).
[edit]
Or you can download BigProcHook.pas , which I created too complex functions and replaced them myself. Then you can write an override that calls the regular ShortCutToText function and replaces the text "Ctrl" with "Strg" (or vice versa) without a menu, even knowing it. But I would use this only as a last resort, because I think itβs better to just transfer the resource. If you want to use the hook, download and turn on the device and add the following code to any block (separate, if you want) a new block.
uses BigProcHook, Menus; var FHook: TBigProcHook; // The replacement function function MyShortCutToText(ShortCut: TShortCut): string; begin FHook.Hooked := False; try Result := ShortCutToText(ShortCut); Result := StringReplace(Result, 'Ctrl', 'Whatever', []); finally FHook.Hooked := True; end; end; initialization FHook := TBigProcHook.Create(@ShortCutToText, @MyShortCutToText); finalization FHook.Hooked := False; FHook.Free; end.
It will replace Ctrl in the text of the label with any text that you like, without the need to change any other code.
Goleztrol
source share