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 

Evaluating: problem with loading SIB at runtime

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



Joined: 12 Mar 2007
Posts: 2

PostPosted: Tue Mar 13, 2007 3:41 pm    Post subject: Evaluating: problem with loading SIB at runtime Reply with quote

Hi - I'm evaluating your product for our company, and have run into some problems. So far I like your product best, but the following scenario needs to work for us.

I've created a test project that works as expected so far. It contains a data module which holds the dispatcher and a TsiLang component. Then the main form and the about box both have a TsiLangLinked component, properly pointed at the global dispatcher instance on the data module. When the translation data for each form is stored in the DFM, everything works as expected at runtime.

However, I want to have a runtime .SIB file, so here's what I've done ...

1. Run the Expert, and chose Save/Load Translation, Save Project, and then I save master.sil. I open this file in a text editor, and verify that captions from both forms are listed correctly. So far, so good.

2. Using the same menu item, I change the file type to SIB, and save runtime.sib.

3. Select all forms in the expert, and choose Clear Translations.

4. At this point, I run the app again and verify that nothing happens when I try to change the translation (I have a combo on the main form which does this). So I know translation data has been cleared.

5. I add the following code to the FormCreate of the main form:

S := ExtractFilePath(Application.ExeName) + 'runtime.sib';
LanguagesDM.Dispatcher.LoadAllFromFile(S);


After this, the main form can now change languages, as expected. However, the About box form, which is created dynamically, does *not* reflect language changes any longer.

Can you tell me what I might be doing wrong? I have uploaded this project to a zip file located here:

http://www.flightrealm.com/localization.zip

Thanks!
Dave
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Tue Mar 13, 2007 4:32 pm    Post subject: Reply with quote

Hi,

Method LoadAllFromFile loads only TsiLang which are created at the call time. In order to be sure other forms loaded as well upon creation just set FileName property of Dispatcher. This is described at http://www.tsilang.com/delphiglobalizationtool_faq.html#19
Additionally you can use OnLinkToDispatcher event and load every TsiLang "manually" since this event is called when new form is created and TsiLang on it links to dispatcher.
Please let me know if this helps.
Back to top
View user's profile Send private message
scoman81



Joined: 12 Mar 2007
Posts: 2

PostPosted: Tue Mar 13, 2007 4:53 pm    Post subject: Reply with quote

Ah yes, thanks. That seems to work. Although, I find that in my test program, I have to do both ... I have to call Load and I also have to set the FileName for any forms created later. (In other words, setting the FileName doesn't affect the form in which that call is made.)

Thanks!
Back to top
View user's profile Send private message
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