Do .sil and .sib files have same functionality

This forum designated to discuss the TsiLang Components Suite.
Post Reply
Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Do .sil and .sib files have same functionality

Post by Malcolm »

v 5.3.0 with D6
Are there situations where only one of these formats can be used?

I have found that with a TsiLangRT, I can .LoadOnCreate from a .sil file but not from a .sib file.

I can get the built-in editor with a TsiLangRT to save to a .sib file OK but I can't get it to read back any changes from an external editor (SILEditor).

Another problem I have with using the TsiLangExpert to create a .sil file is that it runs very slowly and the memory use ramps up from 158Mb to 2Gb on a project with only 41 forms. On completion the memory is not released until I close Delphi. Perhaps I need to re-install TsiLang?

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: Do .sil and .sib files have same functionality

Post by isiticov »

Malcolm wrote:v 5.3.0 with D6
Are there situations where only one of these formats can be used?
Both formats have the same functionality and could be used in all situations except one case (see below). SIB files are just much faster than SIL.
Malcolm wrote:I have found that with a TsiLangRT, I can .LoadOnCreate from a .sil file but not from a .sib file.
This is strange since this shall work in both cases. Be sure that StorageFile property points to correct file.
Malcolm wrote:I can get the built-in editor with a TsiLangRT to save to a .sib file OK but I can't get it to read back any changes from an external editor (SILEditor).
Yes, this is the only place. The built-in editor unable to save/load to/from SIB file only SIL is supported there.
Malcolm wrote:Another problem I have with using the TsiLangExpert to create a .sil file is that it runs very slowly and the memory use ramps up from 158Mb to 2Gb on a project with only 41 forms. On completion the memory is not released until I close Delphi. Perhaps I need to re-install TsiLang?
This is very strange situation. Could you reproduce this on any project or just for one particular project?

Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Post by Malcolm »

Thanks for the quick reply.

Yes, .sib is much faster, that's why I wanted to use it.

I have spent quite a lot of time trying to find the problem here - with no success. I have uninstalled, deleted the siComponents folder tree and searched for other copies of .dcu files. Then I installed again - same problem with making .sil file. I only use siLang in one project at present so I tried with the Demos but they were too small to be sure if they had the same problem. :(

When saving to a .sib file, very little extra memory is used. But it seems that something here is causing a big memory leak when saving the project to a .sil file. :(

I have decided to revert to siLang components and get my end-user translator to simply use the SILEditor with a .sib file. Well .. at least for the present.

Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Post by Malcolm »

PS:

I have just updated to v5.3.1 and now the Save Project to SIL file works without the memory problem :)

kdeberni
Posts: 11
Joined: Tue Aug 17, 2004 12:18 pm

Post by kdeberni »

As we all know "sheet happens" :-) but one way or another you have done a great job with this components so it is OK anyway.

Regarding my problem it is little better. The file is not anymore corrupted but I found a little time and debug all. First I could not find when you are loading tranlsation file (.sil) so I decide to load it "manually". Maybe I explain it better. On the beginning OnCreate of DataModule where I have dispatcher and siLangRT comp I had code:

procedure TdmLanguage.DataModuleCreate(Sender: TObject);
begin
siLangDispatcher.FileName := ExtractFileDir(Application.ExeName) + '\Resources\HAMER.sil';
siLangRT.StorageFile := siLangDispatcher.FileName;
end;

As you can see was not loading file anywhere and it was woking till..??

Today I change code to:

procedure TdmLanguage.DataModuleCreate(Sender: TObject);
begin
siLangDispatcher.FileName := ExtractFileDir(Application.ExeName) + '\Resources\HAMER.sil';
siLangDispatcher.LoadAllFromFile(siLangDispatcher.FileName); //!!!!!!!
siLangRT.StorageFile := siLangDispatcher.FileName;
siLangRT.LoadAllFromFile(siLangRT.StorageFile, True); //!!!!!!!
end;

As you can see now I am loading file. (Active lanuage is set latter in the code).
Am I doing OK?
Maybe some tips.
When are you loading (reloading) the file content?

Thenks agagin.

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

1. As I said in other post, I can't see a reason for you to use TsiLangRT. TsiLang will be enough in your case.
2. When you have set TsiLangDispatcher.FileName property all TsiLang(s) that are managed by this dispatcher will load their content from this file _on connecting_ to this dispatcher. "On connecting" means reading their properties from stream or assigning LangDispatcher property at run-time in your code. Reading properties is performed by Delphi on form creation.
3. So in case you've set FileName property at design-time _all_ TsiLang(s) linked to this dispatcher will load content correctly.
4. But when you assigning FileName property of dispatcher at run-time TsiLang(s) used on already created forms won't be automatically loaded. This is why it is necessary to call LoadAllFromFile() method of dispatcher in order to load all already created TsiLang(s).

Post Reply