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 

Unigui problem

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
d.bernaert@adm-concept.co



Joined: 03 May 2018
Posts: 1

PostPosted: Thu May 03, 2018 9:59 am    Post subject: Unigui problem Reply with quote

Hello,

I'm working on a large Unigui application and I'm facing a problem.
Form creation is handled by Unigui, so I have the following code to show an update form for a table:

Code:
With UserManagementAddFrm do begin
    Caption := LinkedLanguage.GetTextOrDefault('IDS_3' (* 'Toevoegen gebruiker' *) );
      tbl_Sys_UsersEdit.Close;
      lDynWhere := tbl_Sys_UsersEdit.DynamicWhere;
      lDynWhere.Clear;
      lDynWhere.Expression := lDynWhere.NewBinaryExpression('', 'UserId', dboEqual, 0);
      tbl_Sys_UsersEdit.Open;
      tbl_Sys_UsersEdit.Append;
      ComboLanguage.ItemIndex := 0;
      ShowModal(CallBackInsertUpdateUser);
  end;


So the form is created by Unigui.
The problem is the following:
I have GetTextOrDefault items in the main screen and in the update screen.
The translator assigns ID's with the same number in both forms what is perfectly normal in a normal VCL application.
Is this case, the problem is that the translations of the ID's of the main form are used in the update screen.
Let's say I have the following in the main screen:
Code:

Label1.Caption := LinkedLanguage.GetTextOrDefault('IDS_5' (* 'Hello' *) );


In het update screen I have the following:
Code:

Labelname.Caption := LinkedLanguage.GetTextOrDefault('IDS_5' (* 'Name:' *) );
[/code]

At runtime the label LabelName gets the translation Hello where it should be Name:.
How can i fix this?
Do I need to have unique id's in the complete application?

Thx,
Bernaert Dominique
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2121

PostPosted: Thu May 03, 2018 12:13 pm    Post subject: Reply with quote

I'm 100% sure that the problem's origin connected with:
Code:

With UserManagementAddFrm...

and because you have the SAME names for TsiLang components on forms.
Just use form's identifier with TsiLang's method call to explicitly specify from which form you call the code:
Code:

UserManagementAddFrm.LinkedLanguage.GetTextOrDefault('IDS_3' (* 'Toevoegen gebruiker' *) );
and
SomeOtherForm.LinkedLanguage.GetTextOrDefault('IDS_3' (* 'Another value' *) );

smth like this.
Back to top
View user's profile Send private message
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