Delphi: How to localize description for a menu shortcut?
- by Ulrich Gerhardt
Is there a way to get a localized description of a shortcut like Ctrl+Z so that I get "Ctrl+Z" if the app runs on an English system and "Strg+Z" on a German system?
The VCL function ShortCutToText isn't internationalized. The API function GetKeyNameText is a bit better but still not perfect: If one switches the regional settings of a German XP to English (US), it still produces German texts. Besides the results are in CAPITALS which is ugly.
Clarification: I know how I can replace ShortCutToText or the Smkc* resource strings with customized versions. But to use that I need the translated strings. And I would like to get these from the OS (or similar).
Update: It looks like Microsoft expects developers to do the translation on their own - see 2. in Associating a Menu Item with an Accelerator Key.