GETTEXT: retrieving text from strings for non-active languag

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
jdbacco
Posts: 6
Joined: Sat Oct 28, 2006 9:40 am

GETTEXT: retrieving text from strings for non-active languag

Post by jdbacco »

How can I retrieve the text for a string for a language which is not the current language of the TsiLang conponent?
There is no parameter to specify for which language the result should be returned:
Eg : the form is using language 1, but I want to retrieve a value for a string in lagguage 2 because I want to sent it as a title to a report that is printed in laguage 2.
Is this possible.
I would suggest to extend the GETTEXT function with an optional parameter to specify the language: eg Gettext (ID, language)
If no language-parameter is specified, the active language of the TsiLang-component should be used.
Greetings
Johan
Accowin
The Belgian Accounting program
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

You can use

Code: Select all

    function GetStringValue(const AStrings: TStrings; AName: Tstring; ALang: Integer):
      Tstring;
Use siLang1.Strings as AStrings, string ID as AName and ALang- language number to return.
Best regards,
Igor Siticov.
jdbacco
Posts: 6
Joined: Sat Oct 28, 2006 9:40 am

Post by jdbacco »

Thanks
I used SiLang1.GetstringValue( SiLang1.Strings, ID, LanguageNumber)
It works fine.
Accowin
The Belgian Accounting program
Post Reply