Page 1 of 1

SIL Editor

Posted: Fri Oct 19, 2012 10:07 am
by Richard Mueller
Hello,

If I use the 'Remove' command from the SIL Editor to delete one or more languages from an existing .sib file and afterwards load the resulting file into my application, then the number of languages is not read correctly. I found out that the TsiLang.FNumLang property is read correctly, but the TsiLang.LangNames property contains one language name too much (which then leads to the errornously stated number of languages). It seems as if the SIL Editor does not update the LangNames property correctly.

I am using the newest SIL Editor (ver. 6.0.0.41).

Kind regards,
Richard

Posted: Fri Oct 26, 2012 8:09 am
by isiticov
Hello,

How do you load updates SIB file? Did you mean loading it under IDE in TsiLang Expert or at run-time? If you load it under IDE and use TsiLangDispatcher then you have to manually update language settings in Dispatcher. Because TsiLang Expert doesn't update dispatcher it only load content to TsiLang on forms.
If you use run-time loading then TsiLangDispatcher will automatically update language settings in you use LoadAllFromFile() method.

Posted: Fri Oct 26, 2012 8:32 am
by Richard Mueller
I load the sib file druing run-time with the function LoadAllFromFile(). But anyhow, I think that the SIL Editor stores the data in an inconsitent way. Could you check whether the number of languages and the number of languages in the collection of language names match?

Posted: Fri Oct 26, 2012 9:00 am
by Richard Mueller
What I found out:
The method TSIBFileManager.LoadFromStream() loads the data from the stream in the temporary component SI. The corresponding line of code is

SI := TsiCustomLang(AStream.ReadComponent(SI));

If you check now the properties

SI.FNumLang and
SI.LangNames,

then you will see that the number of strings in SI.LangNames is one more than SI.FNumLang says.

Afterwards, when the values of the temporary object SI are assigned to AComp, the SI.LangNames determines the number of languages. This results in a wrong number of languages.

Posted: Wed Oct 31, 2012 8:58 am
by isiticov
Unfortunately, we're unable to reproduce this. Could you please send us sample SIB file that reproduces this error and sample project?