Step 6 Review an Existing Multilingual Variable Optional

Visual LANSA

Step 6. Review an Existing Multilingual Variable (Optional)

REP004 - System and Multilingual Variables

To do this step, your partition must be set up to support development of multilingual applications.

1.  In this step you will create three multilingual variables with English and French values.

a.  From the New button on the toolbar select Multilingual Variable

b.  Ensure the Close option is not selected initially, but do open each multilingual variable in the editor.

c.  Create the following three variables:

Name

Description

*MTXTiiiDETAILS

Details

*MTXTiiiAddress

Address

*MTXTiiiSave

Save

 

     Ensure you close the dialog when creating the third variable.

2.  In the Editor, switch to the Details multilingual variable.

a.  Double click on the Multilingual Details to open the Details tab on the left.

b.  Change the French value to Détails. You can copy this value from the tutorial in the online guide.

c.  Save and close *MTXTiiiDETAILS

d.  Switch to the Address variable, and change the French value to Adresse.

e.  Save and close *MTXTiiiADDRESS

f.  Switch to the Find variable and change the French value to Trouver

g.  Close and save *MTXTiiiFIND.

3.  Create a new form, iiiMultilingual Test.

     Replace all from code with the following:

FUNCTION OPTIONS(*DIRECT)
BEGIN_COM ROLE(*EXTENDS #PRIM_FORM) CLIENTHEIGHT(322) CLIENTWIDTH(391) HEIGHT(360) LEFT(571) TOP(200) WIDTH(407)
DEFINE_COM CLASS(#PRIM_TAB) NAME(#TAB_1) BOTTOMLAYOUTPRIORITY(4) COMPONENTVERSION(1) DISPLAYPOSITION(1) HEIGHT(241) LEFT(8) LEFTLAYOUTPRIORITY(1) PARENT(#COM_OWNER) RIGHTLAYOUTPRIORITY(2) TABPOSITION(1) TOP(8) TOPLAYOUTPRIORITY(3) WIDTH(369)
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(2) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(298) WIDTH(391)
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#FIND) DISPLAYPOSITION(3) LEFT(18) PARENT(#COM_OWNER) TABPOSITION(3) TOP(264)
DEFINE_COM CLASS(#PRIM_TBSH) NAME(#TBSH_1) DISPLAYPOSITION(1) HEIGHT(213) DISPLAYPOSITION(1) HEIGHT(21) LEFT(14) PARENT(#TAB_1) TABPOSITION(1) TOP(16) USEPICKLIST(False) WIDTH(237)
DEFINE_COM CLASS(#PRIM_TBSH) NAME(#TBSH_2) DISPLAYPOSITION(2) HEIGHT(213) DISPLAYPOSITION(1) HEIGHT(21) LEFT(14) PARENT(#TAB_1) TABPOSITION(1) TOP(16) USEPICKLIST(False) WIDTH(237)
DEFINE_COM CLASS(#SURNAME.Visual) NAME(#SURNAME) DISPLAYPOSITION(2) LEFT(16) PARENT(#TBSH_1) TABPOSITION(2) TOP(51) WIDTH(321)
DEFINE_COM CLASS(#GIVENAME.Visual) NAME(#GIVENAME) CAPTION(*MTXTIIIDETAILS) DISPLAYPOSITION(3) LEFT(19) PARENT(#TBSH_1) TABPOSITION(3) TOP(86) WIDTH(326)
DEFINE_COM CLASS(#ADDRESS1.Visual) NAME(#ADDRESS1) COMPONENTVERSION(1) DISPLAYPOSITION(1) HEIGHT(21) PARENT(#TBSH_2) TABPOSITION(1) TOP(21) USEPICKLIST(False) WIDTH(350)
DEFINE_COM CLASS(#ADDRESS2.Visual) NAME(#ADDRESS2) COMPONENTVERSION(1) DISPLAYPOSITION(2) HEIGHT(21) PARENT(#TBSH_2) TABPOSITION(2) TOP(43) USEPICKLIST(False) WIDTH(350)
DEFINE_COM CLASS(#ADDRESS3.Visual) NAME(#ADDRESS3) COMPONENTVERSION(1) DISPLAYPOSITION(3) HEIGHT(21) PARENT(#TBSH_2) TABPOSITION(3) TOP(65) USEPICKLIST(False) WIDTH(350)
DEFINE_COM CLASS(#POSTCODE.Visual) NAME(#POSTCODE) COMPONENTVERSION(1) DISPLAYPOSITION(4) HEIGHT(21) PARENT(#TBSH_2) TABPOSITION(4) TOP(87) USEPICKLIST(False) WIDTH(249)

EVTROUTINE handling(#com_owner.Initialize)
SET #com_owner caption(*component_desc)
ENDROUTINE

EVTROUTINE HANDLING(#FIND.Click)
fetch *all FROM_FILE(PSLMST) with_key(#empno)
ENDROUTINE

END_COM
 

4.  Save your form.

5.  Switch to the Design tab.

a.  Select the push button. On the Details tab changes its Caption to *MTXTiiiFIND, by selecting it using the ellipsis button and Repository Find dialog.

b.  Select the first Tab Sheet (contains Employee Number). Click first on the tab, and then in the middle of the sheet to select it.

c.  Select the second Tab Sheet (contains Address Line 1) and set its Caption to *MTXTiiiADDRESS.

5.  Compile the form.

6.  Execute form iiiMultiLingualTest from the development environment. This is running the form using the English language and it should look like the following:

7.  From the Windows start menu, select LANSA / Exec Form:

a.  Change Language to FRA.

b.  Ensure Render Type = W

     Note: The Form Name will be pre-filled with the Identifier for your form, iiiMultiLingualTest, which was the last form run in the development environment.

c.  Click OK to run the form, using French.

     Enter an employee number such as A0090, A1004 or A1005, and click Trouver.

     Your form should look like the following:

     Note:

  • The field descriptions in French are defined in the Repository for each field
  • The Caption on the Find button and the Tab Sheets are defined by the multilingual variables.