Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

National language support for message output

BeanConnect permits internationalization and localization of the messages of the BeanConnect resource adapter, the BeanConnect proxy and the BeanConnect Management Console. Internationalization and localization means that the messages that a component passes to the users or writes to log files are output correctly for the relevant environment (country, language).

For this, Java offers classes which provide support for internationalization (such as the class Locale). To determine the language in which messages are to be output, there are two criteria in BeanConnect:

  • language (for example en)

  • region (for example US)

The language code is defined as per ISO-639. The possible values for the region are described in ISO-3166.

By default, BeanConnect supplies messages for the language en and the region US. If the user does not make any explicit selection, the default values apply as specified by the current JVM (Default-Locale).

BeanConnect provides two methods of changing these default settings:

  • On starting a Java program, set the locale by defining the following two system properties:

    • net.fsc.tpbasics.i18n.defaultCountry and

    • net.fsc.tpbasics.i18n.defaultLanguage

  • Store the required settings in the file beanconnect_i18n.properties, which must be accessible in the class path of the relevant JVM.

BeanConnect first tries to determine the settings using the system properties. If no system properties have been defined, the system searches for the property file and reads the settings from there. The standard method should be to set the locale in beanconnect_i18n.properties.

Default configuration

A JAR file (BeanConnectI18N.jar) is deployed with the installation of the BeanConnect resource adapter, the BeanConnect proxy or the BeanConnect Management Console. This file must be entered in the class path of the JVM. By default, this file has the following contents:

  • beanconnect_i18n.properties for setting the locale

  • the message files for the individual components (default language: en, US)

  • a number of Java classes (Msg...class) which must remain unchanged in the JAR file.

To allow access to the message files, their names must follow a certain pattern.

Several message files with the name <component>.properties are included. These files act as a fallback and are used if you have given incorrect values for the language and region. The currently used message files are:

Resource adapter

basics.properties
stub.properties
proxy.properties
ui.properties
oltpmsg.properties
jconnect.properties
encoding.properties

Proxy

proxy.properties
oltpmsg.properties

Management Console

mc.properties
tpbasics.properties

In addition, a file <component>_en_US.properties can be contained in the JAR file. This is generally an identical copy of the file <component>.properties, since en_US is the default value for BeanConnect message files.

Examples of file names:

  • proxy.properties

  • proxy_de.properties

  • proxy_en_US.properties

  • proxy_fr_FR.properties

Introducing a new language

You can provide support for other languages by adding message files to the JAR file BeanConnectI18N.jar. These message files are text files and can be edited with a text editor (such as notepad, vi).

The following example shows the steps necessary for support of German messages.

  1. Extract the default message file (for example proxy.properties) from the JAR file

    using the command jar or the program WinZip.

  2. Translate the messages into German.

  3. Store the new message file with the name proxy_de_DE.properties and add it to the JAR file under the same path (net.fsc.tpbasic.i18n.r) as the default file.

  4. Extract the file beanconnect_i18n.properties.

  5. Enter de as the language and DE as the country:

    net.fsc.tpbasics.i18n.defaultLanguage=de

    net.fsc.tpbasics.i18n.defaultCountry=DE

  6. Write the file beanconnect_i18n.properties back to the JAR file.

Apply step 1 to 3 to all the other message files (stub.properties, ui.properties, etc.).

When switching to a new language, note that BeanConnectI18N.jar must be edited for the BeanConnect resource adapter in the file BeanConnect.rar if the connector is deployed.

For the BeanConnect proxy and the BeanConnect Management Console the

BeanConnectI18N.jar file must be edited in the BeanConnect home directory <BC_home>/lib.