Page 1 of 1

How to translate Exceptions?

Posted: Mon Oct 11, 2004 3:51 pm
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.

Posted: Mon Oct 11, 2004 6:48 pm
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