Posted by webmaster Guido on March 20, 2006
In Reply to Internationalizing Delphi-compiled applications posted by Phil p12436 on
March 14, 2006:
The strings you are looking for, are in PAS (unit) files with the word "consts" in the file name, in the $(DELPHI)\Source\VCL folder. For example, in CONSTS.PAS:
resourcestring ... SMsgDlgWarning = 'Warning'; SMsgDlgError = 'Error'; SMsgDlgInformation = 'Information'; SMsgDlgConfirm = 'Confirm'; SMsgDlgYes = '&Yes'; SMsgDlgNo = '&No'; SMsgDlgOK = 'OK'; SMsgDlgCancel = 'Cancel';
The constants above are for the MessageDlg function.
How to safely change those string constants? Example: translate the button captions displayed by the ShowMessage / MessageDlg functions:
1. Copy Consts.pas to your projects folder (do NOT change code in the original VCL folder).
2. Translate the strings in this copy of the file. Note: if a string contains something like #d or
#s be sure not change the #d or #s, because they are used in formatted message boxes - when a message
box displays a string value plus some more info passed with it.
Related Articles and Replies