Loading SIB file into Dispatcher does not work

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
BorisM
Posts: 7
Joined: Fri Jun 13, 2003 10:53 pm
Contact:

Loading SIB file into Dispatcher does not work

Post by BorisM »

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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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: Select all

siLangDispatcher1.LangNames.Assign(siLang1.LangNames);
BorisM
Posts: 7
Joined: Fri Jun 13, 2003 10:53 pm
Contact:

Post by BorisM »

Thanks! I'll try that when I get back to work.
BorisM
Posts: 7
Joined: Fri Jun 13, 2003 10:53 pm
Contact:

Still does not seem to work...

Post by BorisM »

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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Sorry, it should be used the following:

Code: Select all

siLangDispatcher1.LangNames := siLang1.LangNames;
then it would work.
BorisM
Posts: 7
Joined: Fri Jun 13, 2003 10:53 pm
Contact:

Thanks

Post by BorisM »

Thank you! That seems to have worked.
Post Reply