I have a ClientDataset where the fields are defined at Runtime. So, siLang does not know what to translate until after the program is run. How would I make those translation assignments in code during runtime.
thanks,
Kev
Run Time Strings
In your code you can use:
After that you can run TsiLang Expert menu File->Source->With Form
and you will get something like:
Hope this helps.
P.S. Source code translation is detailed described in help file and User's Guide.
Code: Select all
Field1.DisplayLabel := 'Some Caption';
and you will get something like:
Code: Select all
Field1.DisplayLabel := siLang1.GetTextOrDefault('IDS_1' (* 'Some Caption' *));
P.S. Source code translation is detailed described in help file and User's Guide.
Best regards,
Igor Siticov.
Igor Siticov.
GetText
I tried this, but I get Garbage at runtime even though all looks ok in the Translation Editor. The Charset is set to Russian, and the font is set to Arial Unicode. Everything else on the form is ok.
I am using a TntDBGrid from TntWare.
// This is in an OnChangeLanguage Event Handler
MainForm->TntDBGrid5->Columns->Items[0]->Title->Caption =
MainForm->siLang1-> >GetTextOrDefault("IDS_64" /* "Jt." */ );
In the Translation editor it looks like this:
IDS_64 Jt. Труба
thanks
I am using a TntDBGrid from TntWare.
// This is in an OnChangeLanguage Event Handler
MainForm->TntDBGrid5->Columns->Items[0]->Title->Caption =
MainForm->siLang1-> >GetTextOrDefault("IDS_64" /* "Jt." */ );
In the Translation editor it looks like this:
IDS_64 Jt. Труба
thanks
More GetText
Using the Exampl in the help file, this works:
ShowMessage(siLang1.GetText("IDS_64"));
Also the inspector tips show correctly in the IDE. Label->Captions also show fine, but the DBGrid colum titles and Button->Captions do not. I have tried with standard as well as Tnt....
any ideas?
thanks,
Kev
ShowMessage(siLang1.GetText("IDS_64"));
Also the inspector tips show correctly in the IDE. Label->Captions also show fine, but the DBGrid colum titles and Button->Captions do not. I have tried with standard as well as Tnt....
any ideas?
thanks,
Kev
This is because of Ansi to Wide string conversion (in case of Tnt usage) or due to different default locale (since TButton and some others are just wrappers of native Windows controls). If you use Tnt.. then your will need the methods that return WideString. The next version (6.0.1) will have GetTextW() and GetTextOrDefaultW() methods that will return WideString as result and will help you.
Best regards,
Igor Siticov.
Igor Siticov.