How to translate Exceptions?

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Jan
Posts: 2
Joined: Mon Oct 11, 2004 1:59 pm

How to translate Exceptions?

Post by Jan »

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.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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/ ... ptions.zip
Post Reply