Translations

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
Fre_Vdh
Posts: 30
Joined: 20 Oct 2022, 17:49

Translations

Post by Fre_Vdh »

I have a question regarding screen translation.

The way we are working now is that we have :
  • QRPGSRC file
  • QDDSSRC file in Dutch
  • QDDSSRC file in French

On these display files the input fields are on exact the same location in both languages.
We then compile the French screen, then the Dutch screen and then the program.

In the user profile we defined the language of a user and then we know which library list to use.
But, it is possible to switch between languages and then the library list switches.

In the aXes screens, I got the same screen names when they were Dutch or French, so I did a lot of translations in the screens.
For example:
  • A subfile header:

    Code: Select all

    //trigger fields
    var id = FIELDS("Via");
    var idVal = id.getValue();
    //condition
    if (idVal.substring(0, 3) === "VIA"){
    var t = "MY-NR/POLISNUMMER               TYPE POLIS                                                         BEGINDATUM         VVDAG           PREMIE                           MANDAAT         SPL     ATT     WYZ";
    }
    else
    {
    t = "N°Cie/N°-POLICE                  TYPE-POLICE                                                       DATE DÉBUT         ÉCHÉA            PRIME                            MANDAT         FRA     ATT     MOD";
    }
    ENV.returnValue = t;

For the tables I made a Dutch and a French version every time :
  • StaticTables.txt

    Code: Select all

    -- ================================================================================
    -- LandenFR 
    -- ================================================================================
     
    DefineObjectInstance { 
     
         className          = "StaticTable", 
         name               = "LandenFR",   
         source             = "sql", 
         selectSQLcommand   = "lalkkd, lalkom from brstdata.land0 where lataal = '1' order by lalkom",  
         resultColumnNames  = {"value","text"}, 
      }; 
      
    -- ================================================================================
    -- AanschrijftitelNL 
    -- ================================================================================
     
    DefineObjectInstance { 
     
         className          = "StaticTable", 
         name               = "AanschrijftitelsNL",   
         source             = "sql", 
         selectSQLcommand   = "titite, trim(titito) || ' - ' || trim(tititv) from brstdata.titel0 where titaal = '2' order by titito",  
         resultColumnNames  = {"value","text"}, 
      };
  • Then on the dropdownlist (TableName):

    Code: Select all

    //trigger fields
    var id = FIELDS("Land");
    var idVal = id.getValue();
    //condition
    if (idVal.substring(0, 4) === "Land"){
    var t = "LandenNL";
    }
    else
    {
    t = "LandenFR";
    }
    ENV.returnValue = t;

But now I’m wondering if that was the best way of working (taking into account our way of working in the green screens)?
I'm asking this because we have some acquisitions planned and as a result we would have to translate our programs into a few more languages.

Kind regards,
Frederik
tim mcentee
Posts: 40
Joined: 26 Jul 2017, 13:20

Re: Translations

Post by tim mcentee »

Hi Frederik

1) I assume that the original translations from Dutch or French are coming through to the aXes screen correctly. Also that the screen signature is the same. I am also assuming that you are overriding the column heading text, and that looks like a lot of work.

You could put this into the Texts_Cust_ll.txt file in the lang folder. Give the string a name like 'Screen01.ColHeader' : 'col header text'.
Do this for fr & ?? the Dutch extension, When you get your new language you create a new Texts_Cust_<ll>.txt file and change the text but leave the id.

In your screen you assign t = CTEXT('Screen01.ColHeader');

2) I'm not sure what you are trying to do here but I am going to guess that your drop down text changes based on language. There will be a variable in you sql statement that is the difference. So instead of defining two static tables, define one for both Dutch and French, and use a variable for the library name or the selection field.

For variables look at extension tutorial tables and xml documents and Static Tables and SQL Variables section

Tim
Post Reply