Get the original caption after translate

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
magicang
Posts: 12
Joined: Mon May 12, 2003 3:44 am

Get the original caption after translate

Post by magicang »

Hi there,

how can i get the original caption of a button after it have being translate to other language ?

regards,
magic :cry:
gaivans
Posts: 71
Joined: Fri Nov 29, 2002 4:10 pm

Post by gaivans »

Hello,

What do you mean by "it have being translate to other language"? If your TsiLang component has more than one language, then it holds as original captions (Languge #1) as well as translated to other languages ones. You will need just set TsiLang.ActiveLanguage = 1 in design-time and all captions on the form will get their original values.
Best regards,
Serghei Gaivan
magicang
Posts: 12
Joined: Mon May 12, 2003 3:44 am

Post by magicang »

Hi there,

thanks for the quick reply.

what i menas is, after tsilang translate the form, i wan to retrieve the original text of my tbutton without set the language back to original language in run time.

regards,
magaic
gaivans
Posts: 71
Joined: Fri Nov 29, 2002 4:10 pm

Post by gaivans »

Hello,

You can use in run-time the TsiLang's public method
function GetStringValue(AStrings: pStrings; AName: Tstring; ALang: Integer): Tstring;
where AStrings - pointer to a string list; AName - name of a component or string identifier; ALang - number of language (use 1 for default language).

For example, to extract default caption for Button1 you can use:
...
var
S: string;
...
S := siLang1.GetStringValue(@siLang1.Captions, Button1.Name, 1);
...


or more compactly:
...
with siLang1 do
S := GetStringValue(@Captions, Button1.Name, 1);
...
Best regards,
Serghei Gaivan
Post Reply