Page 1 of 1

Global strings

Posted: Mon Jul 10, 2006 8:40 pm
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

Re: Global strings

Posted: Tue Jul 11, 2006 11:51 am
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.

Re: Global strings

Posted: Tue Jul 11, 2006 12:27 pm
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).

Re: Global strings

Posted: Tue Jul 11, 2006 12:46 pm
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).

Posted: Tue Jul 18, 2006 6:49 am
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.

Posted: Tue Jul 18, 2006 12:19 pm
by Ioan
Thanks, Igor.
Good to know both methods.
Ioan