Unigui problem

This forum designated to discuss the TsiLang Components Suite.
Post Reply
d.bernaert@adm-concept.co
Posts: 1
Joined: Thu May 03, 2018 9:27 am

Unigui problem

Post by d.bernaert@adm-concept.co »

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: Select all

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: Select all

Label1.Caption := LinkedLanguage.GetTextOrDefault('IDS_5' (* 'Hello' *) );
In het update screen I have the following:

Code: Select all

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

isiticov
Site Admin
Posts: 2207
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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

Code: Select all

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: Select all

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

Post Reply