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
SIL Editor
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.
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.
Igor Siticov.
-
- Posts: 8
- Joined: Thu Aug 23, 2012 2:49 pm
-
- Posts: 8
- Joined: Thu Aug 23, 2012 2:49 pm
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.
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.