BobyX Posted January 16, 2012 Share Posted January 16, 2012 Hi. How do I change the title of the dialog box or how to display the dialog box title in the selected language? Setting the "ExtLocale" in ServerModule does not change the title of the dialog box, according to the selected language. It is still displayed the english titles, for exemple "Confirm" for a mtConfirmation dialog type. Thanks for the advice. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 17, 2012 Administrators Share Posted January 17, 2012 Hi. How do I change the title of the dialog box or how to display the dialog box title in the selected language? Setting the "ExtLocale" in ServerModule does not change the title of the dialog box, according to the selected language. It is still displayed the english titles, for exemple "Confirm" for a mtConfirmation dialog type. Thanks for the advice. Ext JS doesn't directly implement a default value for title. You must use a translator (like the one integrated in IDE) to translate resourcestring. Quote Link to comment Share on other sites More sharing options...
BobyX Posted January 17, 2012 Author Share Posted January 17, 2012 I'll try to do it. Thanks for the explanation. Quote Link to comment Share on other sites More sharing options...
NelsonFS Posted May 8, 2012 Share Posted May 8, 2012 I'll try to do it. Thanks for the explanation. try this.. unit Funcoes_Traducao_u; { Objetivo: Traduzir automaticamente todas as mensagens do inglês Motivo: O UniGUI da versão atual não tem função de localização das mensagens internas do Delphi No TUniServerModule tem a propriedade ExtLocate que tem que ficar pt_BR para tradução de algumas mensagens para portugues, mas isso será somente para algumas e para Web. Usar o tradutor do delphi vai duplicar o projeto e complicar o processo de desenvolvimento. Fonte: http://leandropiga.nothus.com.br/?p=38 Forma de utilização: Basta adicionar essa unit no projeto. Atualizações: Para traduzir outras mensagens, deve-se buscar nos arquivos de constantes do delphi (Windows, Consts, DBConsts, VDBConsts) a identificação da mensagem e substituir ela conforme abaixo pelo novo nome. } interface uses Windows, Consts, DBConsts, VDBConsts; procedure SetResourceString(AResString: PResStringRec; ANewValue: PChar); const SNewMsgDlgConfirm: PChar = 'Confirmação'; SNewMsgDlgYes: PChar = 'Sim'; SMewMsgDlgNo: PChar = 'Não'; SNewMsgDlgOK: PChar = 'Ok'; SNewMsgDlgCancel: PChar = 'Cancelar'; SNewDeleteRecordQuestion: PChar = 'Excluir Registro?'; SNewDeleteRecord: PChar = 'Excluir Registro?'; implementation procedure SetResourceString(AResString: PResStringRec; ANewValue: PChar); var POldProtect: DWORD; begin VirtualProtect(AResString, SizeOf(AResString^), PAGE_EXECUTE_READWRITE, @POldProtect); AResString^.Identifier := Integer(ANewValue); VirtualProtect(AResString, SizeOf(AResString^), POldProtect, @POldProtect); end; initialization SetResourceString(@SMsgDlgConfirm, SNewMsgDlgConfirm); SetResourceString(@SMsgDlgYes, SNewMsgDlgYes); SetResourceString(@SMsgDlgNo, SMewMsgDlgNo); SetResourceString(@SMsgDlgOK, SNewMsgDlgOK); SetResourceString(@SMsgDlgCancel, SNewMsgDlgCancel); SetResourceString(@SDeleteRecordQuestion, SNewDeleteRecordQuestion); SetResourceString(@SDeleteRecord, SNewDeleteRecord); end. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.