Static string tables

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
pls
Posts: 13
Joined: Mon Feb 09, 2004 8:36 pm
Location: Phoenix, AZ, USA

Static string tables

Post by pls »

How do you handle static string tables that should be translated. As in
static char const *Action[] =
{ "One", "Two", "Three", ...};
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

May be such way would be applicable and helpful:

Code: Select all

AnsiString String1;
AnsiString String2;
AnsiString String3;
static AnsiString * sActions[] =
{ &String1, &String2, &String3};
--------------------

Code: Select all

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  siLangLinked1ChangeLanguage(Sender);
}

void __fastcall TForm1::siLangLinked1ChangeLanguage(TObject *Sender)
{
  String1 = siLangLinked1->GetTextOrDefault("IDS_0" /* "One" */ );
  String2 = siLangLinked1->GetTextOrDefault("IDS_1" /* "Two" */ );
  String3 = siLangLinked1->GetTextOrDefault("IDS_2" /* "Three" */ );
}
pls
Posts: 13
Joined: Mon Feb 09, 2004 8:36 pm
Location: Phoenix, AZ, USA

Post by pls »

Of course. I didn't make the connection with you Pascal code example.

Thanks
Post Reply