SIL Editor

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Richard Mueller
Posts: 8
Joined: Thu Aug 23, 2012 2:49 pm

SIL Editor

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

Post 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.
Best regards,
Igor Siticov.
Richard Mueller
Posts: 8
Joined: Thu Aug 23, 2012 2:49 pm

Post 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?
Richard Mueller
Posts: 8
Joined: Thu Aug 23, 2012 2:49 pm

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

Post by isiticov »

Unfortunately, we're unable to reproduce this. Could you please send us sample SIB file that reproduces this error and sample project?
Best regards,
Igor Siticov.
Post Reply