TIBCO EBX® offers the ability to handle the labeling and the internationalization of data models.
In EBX®, language preferences can be set for two scopes:
Session: Each user can select a default locale from the user pane.
Data model: If a data model has been localized into other languages than those natively supported by EBX®, the user can select one of those languages for that particular data model. See Extending TIBCO EBX® internationalization for more information.
In EBX®, most master data entities can have a label and a description, or can correspond to a user message. For example:
Dataspaces, snapshots and datasets can have their own label and description. The label is independent of the unique name, so that it remains localizable and modifiable;
Any node in the data model can have a static label and description;
Values can have a static label when they are enumerated;
Validation messages can be customized, and permission restrictions can provide text explaining the reason;
Each record is dynamically displayed according to its content, as well as the context in which it is being displayed (in a hierarchy, as a foreign key, etc.);
All this textual information can be localized into the locales that are declared by the module.
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 locales as "dd/MM/yyyy" and "MM/dd/yyyy" in others.
A formatting policy is used to define how to display the values of simple types.
For each locale declared by the module, its formatting policy is configured in a file located at /WEB-INF/ebx/{locale}/frontEndFormattingPolicy.xml
. For instance, to define the formatting policy for Greek (el
), the engine looks for the following path in the module:
/WEB-INF/ebx/el/frontEndFormattingPolicy.xml
If the corresponding file does not exist in the module, the formatting policy is looked up in the class-path of EBX®. If the locale-specific formatting policy is not found, the formatting policy of en_US
is applied.
The content of the file frontEndFormattingPolicy.xml
is as follows:
<?xml version="1.0" encoding="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" groupingSeparator="|" decimalSeparator="^"/> <int pattern="000,000" groupingSeparator=" "/> </formattingPolicy>
The elements date
, dateTime
and time
are mandatory.
The group and decimal separators that appear in the formatted numbers can be modified by defining the attributes groupingSeparator
and decimalSeparator
for the elements decimal
and int
.
There are two ways to express a locale:
The XML recommendation follows the IETF BCP 47 recommendation, which uses a hyphen '-' as the separator.
The Java specification uses an underscore '_' instead of a hyphen.
In any XML file (XSD, formatting policy file, etc.) read by EBX®, either syntax is allowed.
For a web path, that is, a path within the web application, only the Java syntax is allowed. Thus, formatting policy files must be located in directories whose locale names respect the Java syntax.