Page 1 of 1

Loading SIB file into Dispatcher does not work

Posted: Fri Jun 13, 2003 11:06 pm
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

Posted: Sat Jun 14, 2003 6:59 am
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);

Posted: Sun Jun 15, 2003 3:09 am
by BorisM
Thanks! I'll try that when I get back to work.

Still does not seem to work...

Posted: Mon Jun 16, 2003 4:03 pm
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

Posted: Mon Jun 16, 2003 7:14 pm
by isiticov
Sorry, it should be used the following:

Code: Select all

siLangDispatcher1.LangNames := siLang1.LangNames;
then it would work.

Thanks

Posted: Mon Jun 16, 2003 7:27 pm
by BorisM
Thank you! That seems to have worked.