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 

Central Control for Large Application

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



Joined: 22 Sep 2010
Posts: 2

PostPosted: Thu Sep 23, 2010 5:44 pm    Post subject: Central Control for Large Application Reply with quote

Hi,

I have downloaded the latest version and have been trying to figure out how to make the component set work for a large application. I have two primary needs.

First, I need to translate generic terms. For example, I currently might have something like the following for a TLabel caption:

"%Company% Name:"

After construction of the form, I currently process all the Captions and do substitutions. In the above example, the end-user might configure a setting to change the word Company to Organization. Therefore, upon display, the default caption would be "Company Name:" or if the word Company has been renamed, it might read, "Organization Name:". Throughout the application, 200+ forms, there is one method in the ancestor form class that pre-processes all the terminology changes.

The second requirement is to do traditional language changes (english, spanish, japanese, etc). However, because there are 100s of very common terms used throughout the application, I want a central datamodule to process most of the changes. I cannot see how to do this very easily using these components. I did have one idea, which was to have two languages on every form. One called "Default" and the other "Coded." The coded column would have a coded value. When the language is switched to "Coded", it would then call the translation datamodule to process the Code into a translatable term. Using the example above, the "default" value would be "Company Name" and the "coded" value would be "COMPNAME." Then, the translating datamodule would look up "COMPNAME" and use the translated text for "Company Name." Using this example, if there were 100 references throughout the application to "Company Name", it would be automatically changed throughout the application.

Is there another way or suggestion??

Thanks,

Kevin
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Tue Sep 28, 2010 10:34 am    Post subject: Reply with quote

Hello,

I'm not sure if I understood exactly what you wan tto do. But I can suggest the following:
1. You can use "central" translation storage in some datamodule.
2. You can intercept ANY translation change by realizing the TsiInterceptStringChange procedure and assign it to the global variable siInterceptStringChange declared in siComp.pas unit.
Code:
type
  TsiInterceptStringChange = procedure(const AObject: TObject; const PInfo: PPropInfo; var APropValue: string);

AObject - is a TsiLang, which is currently updating any string;
PInfo - is a property to change if any.
APropValue - string value.
You can check what AObject is currently "in process" and the value of the APropValue and decide if you need to get the another translation from another TsiLang (placed in Datamodule for example). You can use GetTranslationByLang() method to get the translations of a value by language.
Hope this helps.
Back to top
View user's profile Send private message
Kevin



Joined: 22 Sep 2010
Posts: 2

PostPosted: Tue Sep 28, 2010 3:29 pm    Post subject: Reply with quote

I guess the main thing I want is a central translation point, rather than form by form. If a user wants to change a common label throughout the application that appears 100+ times, I don't think the user should have to open each form and do a translation for that term. There should be some sort of macro option that is assigned at design time so that a label can be changed throughout the application at runtime with ease.

Thanks,

Kevin
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Wed Sep 29, 2010 2:37 am    Post subject: Reply with quote

TsiLang components are designed to perform the translation on "by form" basis. To quick translate repeated terms there is a tool named Dictionary Manager and Auto-Translate feature in Translation Editor. Additionally, you can change your code by creating some unit with an UI initialization routine where you will assign all your controls with needed captions. Later just let TsiLang Expert translate this routine and add these strings into one single TsiLang from any datamodule. Although this will require quite amount of manual work for you.
Back to top
View user's profile Send private message
Jean-Paul Brassard



Joined: 08 May 2008
Posts: 65

PostPosted: Mon Oct 25, 2010 4:50 pm    Post subject: Reply with quote

Hi Kevin,

To solve similar problems, we did write few pre-processing applications. Those applications read DIX or SIB/SIL files and process all translations in them to perform given tasks.

We also wrote a real time procedure that intercept SIB files reading on the fly. This code could interpret specific directives, such as %xyz or fill a given column with a choosen language.

We also wrote a database layer to interpret translation directives. This layer allows us to translate selected columns of our tables with almost no change in the original DB access code.
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