Page 1 of 1

form in pakage

Posted: Wed Jun 13, 2007 7:09 am
by angelodiego
I have a form in a pakage inherited from one of the forms in my exe, I'd like to load the translation for the base form and then load only a separate translation for the objects added in the package, is this possible?

Posted: Wed Jun 13, 2007 12:08 pm
by isiticov
What do you mean under "load"? Do you mean that you want to load translations from external file at run-time? If yes, then it is not possible to load translations separately except you use MergeAllFromFile() method.

Posted: Wed Jun 13, 2007 11:22 pm
by angelodiego
The problem with merge is that, as far as I can tell, you need an original file with the translation for the form and an additional one with the the missing strings, the classname of the form in the base exe is different from the one in the package so I don't have a complete translation to start with, is it possible to force the load of translation for a different class?

Posted: Thu Jun 14, 2007 4:12 am
by isiticov
Unfortunately, it is not possible to enforce loading of information from different form. If you use SIL file to store translations you can just modify it by replacing form identifier in all entries and then load into another form.

Posted: Thu Jun 14, 2007 5:14 am
by angelodiego
Is there a way of translating a base form and then translate only the objects on the inherited form, inheriting the translation from the base one?

Posted: Thu Jun 14, 2007 7:49 am
by isiticov
If you translate the base form and don't change any translation of its controls in inherited form then it will be re-used by TsiLang. If you change any base control's translation in inherited form then you will need to re-translate base control. Also please be sure to set IsInheritedOwner=True for TsiLang on inherited form.

Posted: Fri Jun 15, 2007 12:11 am
by angelodiego
Does this work also if the translation streamed in the dfm is empty and I load everything from the sib file?

Posted: Fri Jun 15, 2007 1:47 am
by isiticov
No, I guess this won't work when DFM is empty and translations loaded from SIB file. When loading from SIB file TsiLang will just replace internal data with the information from SIB file. So if loading from SIB you need to be sure your SIB includes in inherited form all components translations.