SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MessageDlg String does not apear in siComp

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
kkgian



Joined: 16 May 2003
Posts: 7

PostPosted: Sat May 17, 2003 1:53 am    Post subject: MessageDlg String does not apear in siComp Reply with quote

Greetings,

Code:

...
if MessageDlg('Are you sure?',
                     mtConfirmation,
                     [mbOk, mbCancel], 0) = mrOk then
begin
  Label1.Caption:= 'Yes I am';
end
else
begin
  Label1.Caption:= 'NO, I don''t ';
end;
...


    I can't find the 'Are you sure' in siComp.
    How to do translation for Label1 without predefine constant message string?

TIA

Gian
Back to top
View user's profile Send private message
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Sat May 17, 2003 7:21 am    Post subject: Reply with quote

Hello,

If you use "hard-coded" strings or string constants you need to add them to the Translation Data of corresponding TsiLang component. The easiest way to do it is using TsiLang Expert. Let's suppose you work with "Form1" and this form alredy has a TsiLang component:

1. Launch the TsiLang Expert (Ctrl+L) and select "Form1" in the list view;
2. Click the expert menu "File|Source|With form...". All "hard-coded" strings will be added to the "Strings" property of its TsiLang component. And your code will be modified like this:

Quote:

if MessageDlg(siLang1.GetTextOrDefault('STR_0' (* 'Are you sure?' *) ),
mtConfirmation,
[mbOK, mbCancel], 0) = mrOk then
begin
Label1.Caption := siLang1.GetTextOrDefault('STR_1' (* 'Yes I am' *) );
end
else
begin
Label1.Caption := siLang1.GetTextOrDefault('STR_2' (* 'NO, I don't ' *) );
end;


3. Open the Translation Editor for the siLang1 and enter translations.
4. You may also wish to translate the button captions (in this case "OK" and "Cancel"). Then replace usual "MessageDlg" with the corresponding method of TsiLang, that is just replace
Quote:

if MessageDlg(...

with this:
Quote:

if siLang1.MessageDlg(...

and provide translations for the "Dialogs" property of the TsiLang component.


To learn more about internationalization applications with TsiLang download our "User Manual" from http://www.sicomponents.com/soft/siManual.pdf
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group