unit MsgDlgLanguage;
interface
// Ändert die Beschriftungen gemäss der vorgegebenen Sprache
procedure HookDlgResources(ALanguage: Integer);
implementation
uses
Windows,
Consts;
// Führt das "Hooking" der Sprach-Ressource durch
procedure HookResourceString(ResStringRec: PResStringRec; NewStr: PChar);
var
OldProtect: DWORD;
begin
VirtualProtect(ResStringRec, SizeOf(ResStringRec^), PAGE_EXECUTE_READWRITE, @OldProtect);
ResStringRec^.Identifier := Integer(NewStr);
VirtualProtect(ResStringRec, SizeOf(ResStringRec^), OldProtect, @OldProtect);
end;
procedure HookDlgResources(ALanguage: Integer);
begin
case ALanguage
of
// Deutsch
1:
begin
// Titel für MessageDlg
HookResourceString(@SMsgDlgWarning, '
Warnung');
HookResourceString(@SMsgDlgError, '
Fehler');
HookResourceString(@SMsgDlgInformation, '
Information');
HookResourceString(@SMsgDlgConfirm, '
Bestätigung');
// Buttons für MessageDlg
HookResourceString(@SMsgDlgYes, '
&Ja');
HookResourceString(@SMsgDlgNo, '
&Nein');
HookResourceString(@SMsgDlgOK, '
Ok');
HookResourceString(@SMsgDlgCancel, '
Abbrechen');
HookResourceString(@SMsgDlgAbort, '
&Abbrechen');
HookResourceString(@SMsgDlgRetry, '
&Wiederholen');
HookResourceString(@SMsgDlgIgnore, '
&Ignorieren');
HookResourceString(@SMsgDlgAll, '
A&lle');
HookResourceString(@SMsgDlgNoToAll, '
A&lle Nein');
HookResourceString(@SMsgDlgYesToAll, '
A&lle Ja');
HookResourceString(@SMsgDlgHelp, '
&Hilfe');
end;
// Französisch
2:
begin
// Titel für MessageDlg
HookResourceString(@SMsgDlgWarning, '
Avertissement');
HookResourceString(@SMsgDlgError, '
Erreur');
HookResourceString(@SMsgDlgInformation, '
Information');
HookResourceString(@SMsgDlgConfirm, '
Confirmation');
// Buttons für MessageDlg
HookResourceString(@SMsgDlgYes, '
&Oui');
HookResourceString(@SMsgDlgNo, '
&Non');
HookResourceString(@SMsgDlgOK, '
Ok');
HookResourceString(@SMsgDlgCancel, '
Annuler');
HookResourceString(@SMsgDlgAbort, '
R&ejeter');
HookResourceString(@SMsgDlgRetry, '
&Répéter');
HookResourceString(@SMsgDlgIgnore, '
&Ignorer');
HookResourceString(@SMsgDlgAll, '
&Tous');
HookResourceString(@SMsgDlgNoToAll, '
To&us non');
HookResourceString(@SMsgDlgYesToAll, '
Tou&s oui');
HookResourceString(@SMsgDlgHelp, '
Ai&de');
end;
// Italienisch
3:
begin
// Titel für MessageDlg
HookResourceString(@SMsgDlgWarning, '
Avvertimento');
HookResourceString(@SMsgDlgError, '
Errore');
HookResourceString(@SMsgDlgInformation, '
Informazione');
HookResourceString(@SMsgDlgConfirm, '
Conferma');
// Buttons für MessageDlg
HookResourceString(@SMsgDlgYes, '
&Si');
HookResourceString(@SMsgDlgNo, '
&No');
HookResourceString(@SMsgDlgOK, '
Ok');
HookResourceString(@SMsgDlgCancel, '
Cancellare');
HookResourceString(@SMsgDlgAbort, '
A&bortire');
HookResourceString(@SMsgDlgRetry, '
&Ripetere');
HookResourceString(@SMsgDlgIgnore, '
&Ignorare');
HookResourceString(@SMsgDlgAll, '
&Tutti');
HookResourceString(@SMsgDlgNoToAll, '
Tutti N&o');
HookResourceString(@SMsgDlgYesToAll, '
T&utti Si');
HookResourceString(@SMsgDlgHelp, '
&Aiuto');
end;
end;
end;
end.