runtime packages without form

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Hur Akdulger
Posts: 5
Joined: Fri Apr 18, 2003 7:14 pm

runtime packages without form

Post by Hur Akdulger »

Hi,
I'm new user of TsiLang.

I have got a runtime package without form.
It has got a lot of string constants.

How can I translate them by TsiLangExpert?

Or can anybody tell me another way?

And what will be do when I use this runtime package in my project / EXE file.

Thanx for advance.

Hür Akdülger
gaivans
Posts: 71
Joined: Fri Nov 29, 2002 4:10 pm

Post by gaivans »

Hello,

1) If your RT package does not contain any forms you can add to it a TDataModule and place a TsiLang component on the module. That TsiLang component will serve as a common container for all "hard-coded" strings and constants used in the .bpl. To add "hard-coded" strings to the translation data launch the Expert, click "File|Source|Without form...", and in the dialog "Translating Units without Form" select a unit and specify the data module unit which holds the TsiLang component. Similarly you can add string constants ("File|Const section|Without form...").

2) Next you need to provide a communication between the main application (.exe) and the package (.bpl), i.e., the .bpl should "know" the active language main application uses which. I would suggest the following:
if your .bpl exports some object, add to it a method, for example,

procedure TMyExportedObject.ChangeLanguage(ALangNo: Integer);
begin
Datamodule1.siLang1.ActiveLanguage := ALangNo;
end;

In the main application:
for a TsiLang component in the "OnChangeLanguage" event add call to the above method:

procedure TMainForm.siLang1ChangeLanguage(Sender: TObject);
begin
MyExternalObject.ChangeLanguage(siLang1.ActiveLanguage);
end;

After that the active language of TsiLang component in the .bpl will correspond to that in the main .exe and all strings from the .bpl will be displayed accordingly.
Best regards,
Serghei Gaivan
Post Reply