Problem with a datamodule

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Alejandro Castro
Posts: 1
Joined: Mon Apr 21, 2003 4:27 am
Contact:

Problem with a datamodule

Post by Alejandro Castro »

Hi

I have used the Component with excellents results but now I have a problem

I have a datamodule, the datamodule contains several strings that I want to convert on several languages

I did the usual, I run the TsiLang Expert, extract the strings, assign the ID numbers (from 101 to 120), I translate the strings but my problem is that there are several strings that I cant see. For example on the next code:

xMens:=siLangRT1.GetTextOrDefault('IDS_103' (* 'Enviando correo ' *) );
showmessage(xMens);

The string xMens is always empty (blank), I review the code, the IDs, remove the component and I have repeated the process for several times, I edit the SIL file, etc, etc, etc

My question: Why ? What can I do ?

Thanks in advance
Alejandro
gaivans
Posts: 71
Joined: Fri Nov 29, 2002 4:10 pm

Post by gaivans »

Hello,

It seems that TsiLangRT component does not contain any strings translations at the moment when you call "ShowMessage". The possible reasons might be:
1) Translations data are stored in an external file but the property "LoadOnCreate" of the TsiLangRt is not set to "True". Thus, that .sil file is not loaded.
2) Make sure the property "StorageFile" of the component points to the proper file name.
3) It might be that you have on the main form a siLangRT1, too. So, if you use the above code from the main form, then the compiler calls method GetTextOrDefault of the main form's siLangRT1. To avoid such problem you can check the "Add form name" option of the TsiLangExpert ("Tools|Options...|Strings in source"). Then your code will look like this:
xMens:=DataModule1.siLangRT1.GetTextOrDefault('IDS_103' (* 'Enviando correo ' *) );
That is, the ambiguty will be eliminated.
Best regards,
Serghei Gaivan
Post Reply