SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UseInheritedData

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
EdwardBenson



Joined: 27 Apr 2010
Posts: 2

PostPosted: Thu Apr 29, 2010 2:45 pm    Post subject: UseInheritedData Reply with quote

I have a Delphi project with many inherited forms.

I am using TsiLangLinked component on each form, and loading all translations from a single SIB file,

I want my Descendent forms to pick up default translations from their Ancestor form, so I do not have to re-enter all the inherited translations in the SIB file.

In version 6.0.3.1 there is property "UseInheritedData", which suggests it will do exactly what I want. However it does not work. So I have to duplicate every inherited component for every descendent form in the SIB file.

I have downloaded trial 6.5.0.2, and property "UseInheritedData" is missing from the TsiLangLinked component.

How can I pick up the inherited translations on each descendent form?

Many thanks.
Edward Benson.
Back to top
View user's profile Send private message Send e-mail
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Fri Apr 30, 2010 9:59 pm    Post subject: Reply with quote

You can set IsInheritedOwner=True for all TsiLang components on child (inherited) forms and they will try to use as much inherited data as possible.
Back to top
View user's profile Send private message
Jean-Paul Brassard



Joined: 08 May 2008
Posts: 65

PostPosted: Mon May 03, 2010 5:09 pm    Post subject: Reply with quote

Hi Edward,

We had the same problem two years ago.

Here is what I remember about that problem in 2008.
When we tried reading from DFM, the inherited strings was read from "inherited" Forms. But when we tried reading from SIB, TsiLang componant was unable to fetch strings from the SIB file of the inherited Forms... But this could be different now with newer versions of TsiLang Suite.

Moreover, here is how we solve that anoing problem.
We developped a small basic Form "SilForm" from which all our other forms inherits from. Within SilForm, we put a small piece of code that scans the inheritance hierarchy of the initialized form. If we find some intermediate layers of inheritance, we read the appropriate SIB file(s) to fetch the strings of the running class(es).

Without doing that, when a "child" Form calls a procedure of one of its "parents", the code of said procedure runs with empty strings, or with a copy of the parent's string that has been added in the child's class.

In the 2008 version of TsiLang, we found that such copy of parents string into all their childs and grand childs was random. Some time TsiLang wizard did add them, sometimes it made no copy... So we removed all those copies and add a piece of code in our SilForm to warn us when such duplicate strings are detected.


Last edited by Jean-Paul Brassard on Fri May 28, 2010 3:06 pm; edited 2 times in total
Back to top
View user's profile Send private message
EdwardBenson



Joined: 27 Apr 2010
Posts: 2

PostPosted: Tue May 04, 2010 11:17 am    Post subject: Reply with quote

Hi Isiticov,

I have downloaded version 6.5.0.2. The translation of inherited components from SIB file does not work for me.

I have created a small test project with 1 ancestor form and 1 descendent form. I have a single SIB file for the project. I have set IsInheritedOwner = True on the TsiLangLinked component on the child (inherited) form. The inherited components are not translated.

Regards,
Edward Benson.
Back to top
View user's profile Send private message Send e-mail
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Wed May 05, 2010 6:23 am    Post subject: Reply with quote

Hello,

When loading from SIB it is not possible to handle automatically the DFM inheritance as it is "designed" by Delphi. Because the inheritance of DFM works only "on compilation" time. Some users have created a small routine that performs some additional tricks to handle loading of SIB and inherited forms. If I recall correctly there was such post on the forum.
Back to top
View user's profile Send private message
Jean-Paul Brassard



Joined: 08 May 2008
Posts: 65

PostPosted: Wed May 05, 2010 3:10 pm    Post subject: Reply with quote

Here is one of them:
http://www.sicomponents.com/forum/viewtopic.php?t=886
Back to top
View user's profile Send private message
Jean-Paul Brassard



Joined: 08 May 2008
Posts: 65

PostPosted: Fri May 28, 2010 3:03 pm    Post subject: Reply with quote

isiticov wrote:
...When loading from SIB it is not possible to handle automatically the DFM inheritance as it is "designed" by Delphi. Because the inheritance of DFM works only "on compilation" time. Some users have created a small routine that performs some additional tricks to handle loading of SIB and inherited forms...

As posted earlier, we did create an extension to TsiLang to dynamically load inherited strings.
I did prepare a small demo application, with that extension, to illustrate what happens with and without inheritance corrected by our code.
The source of this demo (with extension) is available for the TsiLang users.
If you are interested, please send me a PM with your name, company and email.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group