04-04-2021, Saat: 20:56
Merhaba
Uzun zamandır kullandığım bir fonksiyonu herkes için paylaşmak istedim. Bu fonksiyon ile windows bölgesel ayarlarına ve diline bağlı kalmadan MessageDialog'ları Türkçe olarak veya revize ederseniz istediğiniz her hangi bir dilde kullanabilirsiniz.
Kullanımı :
Uzun zamandır kullandığım bir fonksiyonu herkes için paylaşmak istedim. Bu fonksiyon ile windows bölgesel ayarlarına ve diline bağlı kalmadan MessageDialog'ları Türkçe olarak veya revize ederseniz istediğiniz her hangi bir dilde kullanabilirsiniz.
function MessageDlgTranslated(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; DefaultButton: TMsgDlgBtn; HelpCtx: Longint = 0): TModalResult; begin with CreateMessageDialog(Msg, DlgType, Buttons) do try Position := poDesktopCenter; case DlgType of mtWarning: Caption := 'Uyarı'; mtError: Caption := 'Hata'; mtInformation: Caption := 'Bilgilendirme'; mtConfirmation: Caption := 'Onaylama'; end; with FindChildControl('Yes') as TButton do begin Caption := 'Evet'; if DefaultButton = mbYes then TabOrder := 0; end; with FindChildControl('No') as TButton do begin Caption := 'Hayır'; if DefaultButton = mbNo then TabOrder := 0; end; with FindChildControl('Cancel') as TButton do begin Caption := 'Vazgeç'; if DefaultButton = mbCancel then TabOrder := 0; end; with FindChildControl('OK') as TButton do begin Caption := 'Tamam'; if DefaultButton = mbOK then TabOrder := 0; end; with FindChildControl('Abort') as TButton do begin Caption := 'İptal Et'; if DefaultButton = mbAbort then TabOrder := 0; end; with FindChildControl('Retry') as TButton do begin Caption := 'Tekrar'; if DefaultButton = mbRetry then TabOrder := 0; end; with FindChildControl('Ignore') as TButton do begin Caption := 'Es Geç'; if DefaultButton = mbIgnore then TabOrder := 0; end; with FindChildControl('Yes to All') as TButton do begin Caption := 'Tümüne Evet'; if DefaultButton = mbYesToAll then TabOrder := 0; end; with FindChildControl('No to All') as TButton do begin Caption := 'Tümüne Hayır'; if DefaultButton = mbNoToAll then TabOrder := 0; end; with FindChildControl('Help') as TButton do begin Caption := 'Yardım'; if DefaultButton = mbHelp then TabOrder := 0; end; Result := ShowModal; finally Free; end; end;
Kullanımı :
if MessageDlgTranslated('Kesim işlemi iptal edilecek onaylıyor musunuz?',mtConfirmation,[mbYes, mbNo],mbYes,0) = mrYes then