Common Units or Forms

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
LanceRasmussen
Posts: 6
Joined: Thu May 20, 2004 12:02 am

Common Units or Forms

Post by LanceRasmussen »

I posted a similar question before, but this was with an earlier edition of tsilang.

Under Delphi 2006, I have a few projects that use several common units. There are some units that are straight PAS units and some units that are DFM/PAS form units.

What would be the best way to provide translatable projects?

Secondly, what would be the best course of action to provide tranlastion for the project? I'm thinking it would be better to have a project based SIL file for each language externally, but does this work when a project has several common units/forms? Or would I be better to keep the translations internally on the main form for each project and then do an export to use the tools to create the translation, then bring them back to the application.

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

Re: Common Units or Forms

Post by isiticov »

LanceRasmussen wrote:Under Delphi 2006, I have a few projects that use several common units. There are some units that are straight PAS units and some units that are DFM/PAS form units.

What would be the best way to provide translatable projects?
To translate units which have associated DFMs you can use as usual TsiLang Expert. In order to be able to re-use them in another project you will just need to add some line of code that will initialize TsiLang properties like LangDispatcher and CommonContainer to point to project's dispatcher and common container (if used).
To translate common units without form you can create one common data-module and use it as translation holder for these units. Later you just add this datamodule to project and initializa dispatcher property as described above.
Secondly, what would be the best course of action to provide tranlastion for the project? I'm thinking it would be better to have a project based SIL file for each language externally, but does this work when a project has several common units/forms? Or would I be better to keep the translations internally on the main form for each project and then do an export to use the tools to create the translation, then bring them back to the application.
First at all, I would recommend to use SIB file instead of SIL, because it is much faster. The method to use depends on your situation and many users select any one. We, in particular, use the second way. All translations stored in DFM and before the release we export them, translate and import back if needed as well as provide SIB for "end-user translation" feature.
Best regards,
Igor Siticov.
LanceRasmussen
Posts: 6
Joined: Thu May 20, 2004 12:02 am

Common Forms

Post by LanceRasmussen »

Thanks for the advice.

So to make sure I understand.... would this be a good idea.

Project specific forms -> DataModuleProject
Put the TSILang, Dispatcher components here.
Put the language link component on each project specific form and link to the project data module

Project specific PAS only files -> Data Module Project
Refer each pas file to the datamodule

Common forms -> DatamoduleCommon
Do I put a dispatcher and Lang here too or just a Link which would point to the project datamodule?
Common PAS -> Datamodule Common
Point to the common data module.


I agree that it sounds beeter to use the SIB. Its a matter of using this as an external SIB file or have a SIB file for all or each language.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Re: Common Forms

Post by isiticov »

LanceRasmussen wrote: Project specific forms -> DataModuleProject
Put the TSILang, Dispatcher components here.
Put the language link component on each project specific form and link to the project data module
Yes.
Project specific PAS only files -> Data Module Project
Refer each pas file to the datamodule
Yes
Common forms -> DatamoduleCommon
Do I put a dispatcher and Lang here too or just a Link which would point to the project datamodule?
No, it is better to link to project dispatcher. Just one-two lines of code actually. But much easier to maintain.
Common PAS -> Datamodule Common
Point to the common data module.
Yes
I agree that it sounds beeter to use the SIB. Its a matter of using this as an external SIB file or have a SIB file for all or each language.
This only depends on your preferences :) You can use either one which you like more, but having one SIB for all languages is easier to maintain (IMHO!).
Best regards,
Igor Siticov.
LanceRasmussen
Posts: 6
Joined: Thu May 20, 2004 12:02 am

Commons

Post by LanceRasmussen »

Igor,

Thanks... for answering all the questions.

If I do link my common forms/Common DataModule for common PAS to the project dispatcher (using code to set the pointer to the project's dispatcher)........ Does each common form/PAS remember its translation? Or do I have to re-enter the translations for each project?
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Translations are stored into each TsiLang on form and linking them to any dispatcher won't erase them. So you can link common forms (modules) to any dispatcher and translations will be re-used.
Best regards,
Igor Siticov.
Post Reply