SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to translate Exceptions?

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Jan



Joined: 11 Oct 2004
Posts: 2

PostPosted: Mon Oct 11, 2004 3:51 pm    Post subject: How to translate Exceptions? Reply with quote

Hi,

I'm using Delphi 6 Pro and TsiLang Suite 5.3.1. I've done the following things:

1. Created a new Delphi project
2. Added a resourcestring like res='some resourcestring'
3. Added ShowMessage(res) to FormCreate
4. Added some code to raise a EDivByZero exception to FormCreate
5. Compiled the project
6. Translated the Form using Tsi Expert
7. Added the resourcestrings from the *.exe to TsiLang using the Wizard from Tsi Expert
8. Translated the resourcestrings for EDivByZero and res
9. Compiled the project once again

When I start the project I get 2 MessageBoxes: One displays my translated res, e.g. "some translated resourcestring", and the other displays the EDivByZero which is NOT translated.

My question is: Is it possible to translate exceptions without having to handle them? And if so how do I do this?

Greetings
Jan.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Mon Oct 11, 2004 6:48 pm    Post subject: Reply with quote

Unfortunately, there are 24 "internal" exceptions which Borland(TM) "decided" to localize only at application initialization. You can investigate SysUtils source and find there the const array called ExceptMap containing pre-initialized array of class and strings for excpetion creation.
So the possible "common" way could be the following sample :

http://www.sicomponents.com/soft/demos/TsiLangInternalExceptions.zip
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group