Global strings

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Ioan
Posts: 22
Joined: Tue Mar 14, 2006 8:32 pm
Location: Canada
Contact:

Global strings

Post by Ioan »

Hi,

I have a Delphi application with > 100 forms and units. I like to know if is any way to group together some very common strings (including captions?), so I can use only one occurence instead of one (or more) per form.

In the same idea, if I have one big SIB file including all forms' translations, is there any way to search for a specific string through the entire file?

Thanks,
Ioan
Haron
Posts: 39
Joined: Thu Mar 11, 2004 6:29 am

Re: Global strings

Post by Haron »

> is any way to group together some very common strings (including captions?), so I can use only one occurence instead of one (or more) per form.

I doubt it is possible using standard siComponents features. But what about run-time initialization ? Can you create simple procedure that will change Captions and another common strings at form to translated strings using general TsiLang storage / file ?

> is there any way to search for a specific string through the entire file?

Design time ? Run-time ? What problem, I don't understand, sorry.
Ioan
Posts: 22
Joined: Tue Mar 14, 2006 8:32 pm
Location: Canada
Contact:

Re: Global strings

Post by Ioan »

Haron wrote:> is there any way to search for a specific string through the entire file?

Design time ? Run-time ? What problem, I don't understand, sorry.
In SIL Editor. For what I now, the Find and Replace functions are enabled only at the Form / Category level (Captions or Strings, etc).
If I have the same string ("user") used as a Label's caption and in some strings too, I want to Find (and maybe Replace) all the occurences.
Haron wrote:> is any way to group together some very common strings (including captions?), so I can use only one occurence instead of one (or more) per form.

I doubt it is possible using standard siComponents features. But what about run-time initialization ? Can you create simple procedure that will change Captions and another common strings at form to translated strings using general TsiLang storage / file ?
I have many strings repeated again and again in different forms as Labels or strings. I would like to have them translated only once in a common place in the SIB file and the on each form to use the same entry from the SIB.
Of course, I could put them all in the main form and then when create any other form to use the corresponding entry from the main, but with a lot of occurences is difficult to find every occurence (at design time if not at run time).
Haron
Posts: 39
Joined: Thu Mar 11, 2004 6:29 am

Re: Global strings

Post by Haron »

> If I have the same string ("user") used as a Label's caption and in some strings too, I want to Find (and maybe Replace) all the occurences.

Ah, yes, clear now. No, it is not possible to find through different categories.

> I have many strings repeated again and again in different forms as Labels or strings.

Yes, typical case.

> I would like to have them translated only once in a common place in the SIB file and the on each form to use the same entry from the SIB.

It is only possible if you implement run-time initizaliation. Since component translation is much more than only text (but also char set, font, etc), it is not *flexible* to use single SIB for all forms. But nobody prevent you to load text from central storage if found there (override local translation).
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Sorry for delay with reply.
For "auto" translation of many similar terms you can use Dictionary Manager:
1. Just add terms to Dictionary Manager.
2. In SIL Editor select Top-node in the left Tree.
3. Select in menu Tools | Dictionary | Auto-translate
This will translate all sub-nodes of selected tree-node.

To use some "global run-time" storage for common translations you may take a look at resource strings translations with TsiLang:
1. You declare your global strings as resourcestring in some unit which will be used by others.
2. Using TsiLang Resource Strings Wizard you import these strings to TsiLang and translate them in Translation Editor.
3. Later at run-time each time you will refer to these resource strings TsiLang will automatically translate them.

Please let me know if this helps.
Best regards,
Igor Siticov.
Ioan
Posts: 22
Joined: Tue Mar 14, 2006 8:32 pm
Location: Canada
Contact:

Post by Ioan »

Thanks, Igor.
Good to know both methods.
Ioan
Post Reply