Home > References

Labeling and Localization

Overview

EBX.Platform offers a whole set of capabilities in order to handle the labeling and the internationalization related to a particular adaptation model.

Localization of the user interaction

In EBX.Manager, the user can select his preferred language on two scopes:

  1. in his profile page, he can select the default locale for his session.

  2. if an adaptation model has been localized to other languages than those natively supported by EBX.Platform (see below), the user can also select one of them in the context of this adaptation model.

The languages supported by a particular adaptation model must be specified in its module declaration .

Textual information

In EBX.Platform, most of Master Data entities can have a label, a description, or can correspond to a user message. For example:

Obviously, all this textual information can be localized according to the declared locales of the module (see previous section).

For more information, see the chapter Labels and messages , Tables declaration , Foreign keys declaration , and other entities' documentation.

Values Formats

When a value is displayed to the user, it is formatted according to its type and the formatting policy of the current locale. For example, a date will be displayed in some languages as "dd/MM/yyyy".

The next section describes how to define and customize formatting policies.

Formatting policies

A formatting policy is used to define how to display values of the simple types .

For each locale declared on the module (see section above), its formatting policy is configured by means of a file whose path is: /WEB-INF/ebx/{locale}/frontEndFormattingPolicy.xml . For instance, to define the formatting policy for the greek ( el ), the engine will look for the following path in the module:

/WEB-INF/ebx/el/frontEndFormattingPolicy.xml

If the corresponding file does not exist, the formatting policy is looked up in the root module, ebx-root-1.0 . If not declared in root module, the formatting policy of en_US is adopted.

The content of the file frontEndFormattingPolicy.xml is as follows:

<?xml version="1.0encoding="UTF-8"?>
<formattingPolicy  xmlns="urn:ebx-schemas:formattingPolicy_1.0
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:ebx-schemas:formattingPolicy_1.0 ../schema/ebx-reserved/formattingPolicy_1.0.xsd">
    <date pattern="dd/MM" />
    <time pattern="HH:mm:ss" />
    <dateTime pattern="dd/MM/yyyy HH:mm" />
    <decimal pattern="00,00,00.000" />
    <int pattern="000,000" />
</formattingPolicy>

The elements date, dateTime and time are mandatory.

Syntax for Locales

There are two ways to write a locale:

  1. The XML recommendation follows the IETF BCP 47 recommendation, which uses the hyphen '-' as a separator.

  2. The Java Specification uses the underscore '_' instead of the hyphen.

In any XML file (XSD, formatting policy file, ...) read by EBX.Platform, both syntaxes are allowed. For webpath (i.e. path within the webapp), only the Java syntax is allowed. So, a formatting policy file must be located in a directory whose name is a locale respecting the Java syntax.

Home > References