Maybe a minor bug

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
chouproute
Posts: 22
Joined: Tue Feb 03, 2004 9:13 pm
Location: Québec

Maybe a minor bug

Post by chouproute »

I create this button :

procedure TForm1.Button5Click(Sender: TObject);
begin
Label1.Caption := siLang1.GetTextOrDefault('IDS_2' (* 'Manche de pelle' *) );
end;


And this two others(To change language):

procedure TForm1.Button4Click(Sender: TObject);
begin
silang1.ActiveLanguage := 1;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
silang1.ActiveLanguage := 2;
end;

The Default language is 1(French)
So when I click on Button5, the message 'Manche de pelle' is showing in Label1. If I click on Button3, to switch the language to English, the Label don't switch into English. I need to click on Button5 to have the English Version. :?

If I leave this Like that, And I click on Button4 to switch language into french, the caption on Label1 becomes Label1....?!?! :(

By Default, Label1.Caption = ''(I Erased the Caption in Object Inspector)
:?:

Thanks! :wink:
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

When switching languages TsiLang won't call any your procedure call, instead placed in OnChangeLanguage event. In order to translate label's caption you can just use Captions property of TsiLang which responds for translating all captions. In case you need manually translate Caption property or anything else and reflect to language changing then it would be useful to place the code for updating properties to OnChangeLanguage event.
It is strange that label
s caption becomes Label1 when you switch to language #1 (may be there is some bug in our code we will check) but in order to exclude label from translation you can add it to DoNotTranslate property.

Hope this helps.
Post Reply