Hi there,
how can i get the original caption of a button after it have being translate to other language ?
regards,
magic
Get the original caption after translate
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.
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
Serghei Gaivan
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);
...
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
Serghei Gaivan