Dialog messages on datamodule

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Dialog messages on datamodule

Post by nickg »

Hi, I'm using Delphi7 pro with siLang 6.1.0.1 on XP Pro.

I have a siLang component on a datamodule type form with no font property, and when I change language to a unicode language like Japanese, the dialog captions and the hardcoded GetTextOrDefault message are not displaying properly. The translations for ansi languages like Spanish or Swedish are no problem, but not Japanese, Korean etc.

In the silang components ChangeLanguage event I change the Silang1.CurrentCharset property but it doesn't seem to make any difference. I'm using a function I wrote which is passed the ActiveLanguage integer property value, and returns the correct Charset, and this function works fine on other ordinary forms. Is there something else I need to do? There doesn't seem to be a CurrentFont property for SiLang components or the dispatcher either.

TIA Nick
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Do you use Unicode controls in dialogs like described here: http://www.tsilang.com/delphiglobalizat ... aq.html#21 ?
Best regards,
Igor Siticov.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Dialog messages on datamodule

Post by nickg »

Hi Igor,

It's the siLang.MessageDlg function that I'm using. I read the FAQ, but I'm giving users the ability to change language regardless of the machines locale, and I hoped that changing the CurrentCharset would make that possible. If it doesn't I will have to create a fake dialog, or possibly use ElPacks unicode ElPromptDialog component instead. I have elPack controls on all the other forms in the project and everything else works fine.

Regards, Nick
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hi Nick,

siLang.MessageDlg method uses standard VCL controls like TForm, TButton and others to build the dialog form. These controls are ANSI anf have all limitations of ANSI controls. In order to be able to use and display Unicode in MessageDlg method you need to "tell" TsiLang which controls to use instead of standard. If you have ElPack controls then you can "tell" TsiLang to use ElPack controls, something like:

Code: Select all

  MsgDlgFormClass := TElForm;
  MsgDlgLabelClass := TElLabel;
  MsgDlgEditClass := TElEdit;
  MsgDlgButtonClass := TElButton;
In this case TsiLang will create and use these controls in MessageDlg and will be able to display unicode.

Please let me know if this helps.

P.S. ElPack control types may differ, I just guessed the names.
Best regards,
Igor Siticov.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Dialog messages on datamodule

Post by nickg »

Where and how do I use that code, MsgDlgFormClass doesn't appear to be a property of the siLang Component?

Nick
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Nick,

:) as it is stated in http://www.tsilang.com/delphiglobalizat ... aq.html#21 entry ;-) this code must be added to initialization section of any unit in your project.
Those are global class variables defined in siComp.pas unit.
Best regards,
Igor Siticov.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Dialog messages on datamodule

Post by nickg »

That didn't work either I'm afraid, I think I'll go with the ElPromptDialog for now.

Thanks for your help Igor, Regards, Nick
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

If you send us sample project that reproduces the problem then we will try to find the origin of it.
Best regards,
Igor Siticov.
Post Reply