Localizing Display Names

Localized display names can be added by creating new DefaultPreferences_<locale>.properties files for each DefaultPreferences.xml file created under directory EJBServer\components\<component_name>\userpreferences. <locale> represents the intended locale of the properties file and <component_name> is the name of a component within the component directory.

For example, to support the en_US locale, you should create the following default preference properties file

        DefaultPreferences_en_US.properties

As there may exist multiple DefaultPreferences_<locale>.properties files in different components, the contents of these default preference properties will be merged to a MergedDefaultPreferences_<locale>.properties file according to the SERVER_COMPONENT_ORDER1. This merging happens when running either of the following targets: mergeuserpreferenceproperties, server.

Before merging the.properties files, the following validations will cause an error during a build where:

The infrastructure will attempt to display the correct localized name by matching the country part and language part of the user's locale. If the country part does not exist, the infrastructure will attempt to match the language part only, and if this does not exist it will fall back to a default language. The localization of display names is illustrated below.

If the user is associated with the locale fr_CA, then the application searches the MergedDefaultPreferences_<locale>.properties files for the display names in the following order:

1) MergedDefaultPreferences_fr_CA.properties
2) MergedDefaultPreferences_fr.properties
3) MergedDefaultPreferences_en.properties
4) MergedDefaultPreferences.properties

The system first attempts to locate the correct display name for the fr_CA locale in a MergedDefaultPreferences_fr_CA.properties file. If this file does not exist, or if the display name for the user preference does not exist within this file, then the system looks for MergedDefaultPreferences_fr.properties. If this file does not exist, then the system will search for a MergedDefaultPreferences_en.properties file where locale is set to the default system locale. If the display name is not present the system will fall back to the MergedDefaultPreferences.properties file.

In the case where the display name is not found in any of the properties files (or the properties files do not exist), the value defined for the name attribute for a user preference in the DefaultPreferences.xml file will be used as the display name. See User Preferences Definition for more details on the name attribute.

Similarly, if the user is associated with the locale en_US, then the application searches for the display names in MergedDefaultPreferences_<locale>.properties files with the following priority.

1) MergedDefaultPreferences_en_US.properties
2) MergedDefaultPreferences_en.properties
3) MergedDefaultPreferences.properties
1 See Customizing a Message File, for further explanation of SERVER_COMPONENT_ORDER.
2 See The Format of Message Files, for further explanation of SERVER_LOCALE_LIST.