SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

runtime packages without form

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Hur Akdulger



Joined: 18 Apr 2003
Posts: 5

PostPosted: Fri Apr 18, 2003 7:21 pm    Post subject: runtime packages without form Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Sun Apr 20, 2003 9:31 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group