We help IT Professionals succeed at work.

My version of Delphi is in french, but I want to have error message in english, how to?

Marc582
Marc582 asked
on
Medium Priority
285 Views
Last Modified: 2012-05-05
Hi all,

My version of Delphi is in french, but I want to have error message in english,

if I use windows API, if a error message pop up, it will be shown in the language of the computer where it is executed, but when I use function of VCL, error message appear to be in french even if the local language of the computer where it is executed is english,

how to fix that? do I really have to get an english version of Delphi?

when I check resource of my compiled application, there is one named "String", inside this, there is many errors message, but they are in french, I attached a screenshot,


any idea?

500 points for this one, thx
2008-01-28-231007.jpg
Comment
Watch Question

software developer
CERTIFIED EXPERT
Top Expert 2008
Commented:
>>but when I use function of VCL, error message appear to be in french even if the local language of the computer where it is executed is english

maybe you could get english resourestrings for native VCL but if you have some third party components then all messages will be in language those components were created with.
If you want to create multinational applications try delphi built-in tool or check out multilizer (http://www.multilizer.com/)

ziolko.

Author

Commented:
>> maybe you could get english resourestrings for native VCL but if you have some third party components then all messages will be in language those components were created with.

yea I know this, my worry is about the VCL itself since all of component I use are English based.

I'm still looking for solution other than http://www.multilizer.com/)
Lukasz Zielinskisoftware developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
>>yea I know this, my worry is about the VCL itself since all of component I use are English based.

I think the best method is to use english Delphi, I did quick search over VCL source code and I've found more than 300 files containing >>resourcestring<< keyword

ziolko.

Author

Commented:
ok, maybe you are right, I let this open to see if someone else has a better/quicker solution for me
Mike LittlewoodEngineer
CERTIFIED EXPERT

Commented:
I'm not sure if you are just on about the delphi IDE, or one of your own applications.
If it's the IDE then yes I would agree you should buy an english version.

Its been a long time since I did any multi lingual applications, but if I remember right we always used to use the translation repository. Here you can specify multiple language messages and set application properties so that it can work out which message string it should be displaying.
developmentguruPresident

Commented:
What method are you using?  If you simply use

MessageDlg('My Error Message', mtWarning, [mbOK]. 0);

Then the text you place in the quotation marks is the text the user sees.  There is no auto translation function built into Delphi.  One way to handle this would be to have a global exception hook that catches types of errors and translates the types to english (if the automatic exception handling is the problem).

this line can be placed in the OnCreate of your main form (will not catch errors before the main form is displayed)

  Application.OnException := MainExceptionHandler;

with the following private declaration and method definition

    procedure MainExceptionHandler(Sender: TObject; E: Exception);

procedure TfMain.MainExceptionHandler(Sender: TObject; E: Exception);
begin
  if E is EDivideByZero then
    begin
      MessageDlg('Divide By Zero', mtWarning, [mbok], 0);
      exit;
    end;

  //next test
end;

Author

Commented:
yea but would be too much hassle to make the exeption handling message for every possible error in VCL, yea I think I'll switch to an english delphi then

btw yea I'm not talking about the language of the IDE, but the error message of the VCL, as u can see in the screen I posted, when compiled by a french delphi, error message will be in french (error from VCL, not from API of cours which depends on the local language of the comp)
Mike LittlewoodEngineer
CERTIFIED EXPERT

Commented:
That is why I said to try using the translation repositoy built in with delphi. It should allow you to use multiple languages.
Mike LittlewoodEngineer
CERTIFIED EXPERT

Commented:
oops sorry I didnt read your last post, please ignore me.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.