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 

Loading SIB file into Dispatcher does not work

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



Joined: 13 Jun 2003
Posts: 7

PostPosted: Fri Jun 13, 2003 11:06 pm    Post subject: Loading SIB file into Dispatcher does not work Reply with quote

Hello.

I am trying to load an SIB file into the Language Dispatcher at run time:

siLangDispatcher1.FileName := 'Maintenance.sib';
siLangDispatcher1.LoadAllFromFile('Maintenance.sib');
siLangDispatcher1.ActiveLanguage := 1;

The file, when viewed in the editor, has 2 languages defined (English and Chinese). However, after loading, Dispatcher still holds only one language.

Exporting the very same file in SIL format and using the SIL file instead (exactly the same code) works just fine.

Any ideas what the problem is?

Thanks!

Best wishes,
-Boris
Back to top
View user's profile Send private message Visit poster's website
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Sat Jun 14, 2003 6:59 am    Post subject: Reply with quote

When loading from SIB file the dispatcher languages are not updated, but when loading from SIL file they do automatically. So it works, and in order to update the dispatcher's languages you can just use something like following:

Code:
siLangDispatcher1.LangNames.Assign(siLang1.LangNames);
Back to top
View user's profile Send private message
BorisM



Joined: 13 Jun 2003
Posts: 7

PostPosted: Sun Jun 15, 2003 3:09 am    Post subject: Reply with quote

Thanks! I'll try that when I get back to work.
Back to top
View user's profile Send private message Visit poster's website
BorisM



Joined: 13 Jun 2003
Posts: 7

PostPosted: Mon Jun 16, 2003 4:03 pm    Post subject: Still does not seem to work... Reply with quote

Sorry, this does not seem to work. Even after I assign language names from siLang1, I still have only 1 language in the Dispatcher...

If I assign siLangDispatcher1.NumOfLanguages := 2;

then deverything seems to work, and language names are picked up properly from the SIB file. But of course I do not necessarily know the actual number of languagees at design time.

Is there some other trick to find the number of languages present in the SIB file and assign it to the Dispatcher?

Thanks!
-Boris
Back to top
View user's profile Send private message Visit poster's website
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Mon Jun 16, 2003 7:14 pm    Post subject: Reply with quote

Sorry, it should be used the following:
Code:
siLangDispatcher1.LangNames := siLang1.LangNames;

then it would work.
Back to top
View user's profile Send private message
BorisM



Joined: 13 Jun 2003
Posts: 7

PostPosted: Mon Jun 16, 2003 7:27 pm    Post subject: Thanks Reply with quote

Thank you! That seems to have worked.
Back to top
View user's profile Send private message Visit poster's website
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