I'm currently evaluating TsiLang Components and have some problems with translating the const section. After translating the strings I'm trying to run my program, but is fails to start giving me a Stack Overflow message.
Any help would be apreciated.
Regards
Anske
Problem with const section
This works fine.
I'm using the components on a datamodule which is autocreated before the mainform (in both apps)
I put for testing a breakpoint on the 'Updatestrings' in both the 'oncreate' as well as in the 'changelanguage' procedures and found out that in my 'problem' app the oncreate is never called (property settings are OK) in the little demo app this works fine
I'm using the components on a datamodule which is autocreated before the mainform (in both apps)
I put for testing a breakpoint on the 'Updatestrings' in both the 'oncreate' as well as in the 'changelanguage' procedures and found out that in my 'problem' app the oncreate is never called (property settings are OK) in the little demo app this works fine
Same Error in current TSILang 6.0.4
Hi!
In my (big) project I have the same problem with Stack-Overflow.
Now I found the error. It is a problem of TSILang-Expert that can be reproduced. My project has some inherited frames and when Expert modifies code of const section, it adds (by mistake?) the line "UpdateStrings" in the same procedure UpdateStrings which causes this infinte loop. Here's what the Expert does:
// Complete proc added by Expert
procedure TMyFrame.siLang1ChangeLanguage(Sender: TObject);
begin
UpdateStrings;
inherited;
end;
// Complete proc added by Expert
procedure TMyFrame.UpdateStrings;
begin
sAlarm_1000 := siLang.GetTextOrDefault('strsAlarm_1000');
sTooHigh := siLang.GetTextOrDefault('strsTooHigh');
sTooLow := siLang.GetTextOrDefault('strsTooLow');
sOK := siLang.GetTextOrDefault('strsOK');
UpdateStrings; // ERROR!!!!
inherited;
end;
Well I also found out, that Expert will not always produce this error. My project has about 50 Frames an the error occured only in about 35-40 Frames.
Any suggestion about this?
Regards
In my (big) project I have the same problem with Stack-Overflow.
Now I found the error. It is a problem of TSILang-Expert that can be reproduced. My project has some inherited frames and when Expert modifies code of const section, it adds (by mistake?) the line "UpdateStrings" in the same procedure UpdateStrings which causes this infinte loop. Here's what the Expert does:
// Complete proc added by Expert
procedure TMyFrame.siLang1ChangeLanguage(Sender: TObject);
begin
UpdateStrings;
inherited;
end;
// Complete proc added by Expert
procedure TMyFrame.UpdateStrings;
begin
sAlarm_1000 := siLang.GetTextOrDefault('strsAlarm_1000');
sTooHigh := siLang.GetTextOrDefault('strsTooHigh');
sTooLow := siLang.GetTextOrDefault('strsTooLow');
sOK := siLang.GetTextOrDefault('strsOK');
UpdateStrings; // ERROR!!!!
inherited;
end;
Well I also found out, that Expert will not always produce this error. My project has about 50 Frames an the error occured only in about 35-40 Frames.
Any suggestion about this?
Regards