Page tree
Skip to end of metadata
Go to start of metadata

Text and Localization in the EUI

Text that appears throughout the EUI is controlled by the macro $ewText.get() and a set of variables in the translation.properties record.

The macro $ewText.get(“key”) finds the appropriate translation.properties file based on the user’s session locale. In the translation.properties file, each “key” is associated with a text string, and the $ewText.get macro substitutes this value in the page.

For instance, the home page contains the following link:

<a href='#ew_forward("new_helpdeskcase.html")'>$ewText.get('home.hc.new.link')</a>

The link’s text is defined by the home.hc.new.link variable in the appropriate translation file, for instance, “Create a Helpdesk Case” for English or “Создать запрос” for Russian.

In translation.properties, the text keys begin with home.doc.h3.

#These variables provide the text on the home pages
home.doc.h3=Documents
home.doc.faq.link=FAQs
home.doc.new.link=Create a Document
home.doc.my.link=View My Documents
home.doc.all.link=View All Documents
home.hc.h3=Helpdesk Cases
home.hc.faq.link=FAQs
home.hc.new.link=Create a Helpdesk Case
home.hc.my.link=My Helpdesk Cases
home.rep.h3=Repair Requests
home.rep.new.link=Create a Repair Request
home.rep.my.link=View My Repair Requests
home.sc.h3=Support Cases
home.sc.faq.link=FAQs
home.sc.my.link=View My Support Cases
home.sc.new.link=Create a Support Case
home.con.h3=Contracts
home.con.my.link=View My Contracts
home.con.all.link=View All Contracts
home.con.new.link=Create a Contract Request
home.cr.h3=Change Requests

Changing Text in the Interface

To alter the text in a template page...

  1. Open the applicable template to find the name of the variable that defines the text you want to change.
  2. Open the translation.properties template and find the variable, then edit the text that follows the equals sign (=).

Text variables are organized by function (home page, menu, title bar) and then by table to help you determine which variables apply to which text based on the variable name.

Why not enter text directly in page templates?

You might feel that substituting variables is a rather indirect way to manage text on the page, and indeed it would be simpler to edit text directly on the various pages. There is nothing to prevent you from bypassing the $ewText.get macro and simply entering text directly into the EUI Template pages if you want to.

There are two main reasons the interface uses variables for text:

  • Support for multiple language usage.  By using variables, the admin can create a full translation of the end user interface by simply copying the translation.properties template to a new one with a different language attached, e.g. translation_fr.properties.  The text values in that file can then be translated so that someone logging in to the program with the French locale will see the translated French text values.
  • Consistency and ease of changes. It is easier to make a consistent terminology change when the text variables are separated into a single file. Each home page variant references the same set of text variables. By using the same variables in each home page, if you decide to change the name of a table, for instance, from Support Cases to Support Tickets, you can go to the translation templates and make all the terminology changes across the board in one place.

Localization with ewText.get

The purpose of the $ewText.get() method is to allow for a multilingual environment. The method #ewtText.get($key) works together with another EUI template, translation.properties. Translation.properties is actually a family of templates; the default  Agiloft setup includes several localization files such as translation_ru.properties and translation.zh.properties which hold Russian and Chinese text respectively. For more information, see Localization.

The file translation.properties is used when no locale is set for the user's session. This is initially in English, but you could choose to use a different default locale/language.

Each row of translation.properties consists of a key/value pair, in the form key1=value1

Example

home.1table.title=Welcome to the Agiloft custom portal.

In this case, home.1table.title is the key, and the value is the text "Welcome to the Agiloft custom portal".

The $ewText.get($key) method checks each user's session locale and uses that to determine which translation_xx.properties file to use. Setting the session locale can be done in a number of ways.

  • One possibility is to set the locale in the login link using lang=XX.
  • Another is to use the #ew_languages macro to display a list of available languages for the user. 

For more information on  Agiloft's localization-related macros, see EUI Macro Reference

Example

Let's add a new key/value pair to translation.properties. Bear in mind that in a multilingual environment, the key and its translated value must be added to each translation template file.

  1. Open translation.properties from the EUI Templates table and add the following line of text under #These variables provide the text on the home pages:

    menu.new.task=Task
    newtask.title=Create a Task | Agiloft End User Portal
    newtask.header=Create a Task
  2. Click Save.
  3. Now open new_task.html and make the following changes in the Body field:
    1. Within the <title> tags, replace register.title with newtask.title.
    2. Within the <h2> tags, replace Register with Create a Task.
  4. Save the record, log back into the EUI, and note the changes.
  • No labels