National Language Support

The Desktop component can support different languages using the ResourceBundle and SampleResourceBundle classes. The first class externalizes all the strings that always appear in the Desktop such as the titles of the progress bars when initializing the Desktop and the text of the popup menus. The second class externalizes the values of all the strings defined in the Desktop xml such as the tooltipText of labels, short descriptions, mnemonics, and text of labels.

To support the ability to provide translations and localizations, the Desktop component uses the National Language Support provided by Java, which requires a new ResourceBundle class for each new locale being supported. The resource bundles contain key-value pairs. The keys uniquely identify a locale-specific object in the bundle. There must be a matching key-value pair for all Strings contained in the Desktop XML file.

When the system initializes the Desktop, it searches in the appropriate resource bundle for the strings that appear in the Desktop xml file. These strings are the keys and the system returns the value in the resource bundle that is paired with the key as the localized String. For example, the Desktop XML contains the following tag:

<TaskLauncherButton longDescription="Withdrawal_Op" 
    operation="customerSearchClientOp" label="CashWithdrawal" 
    shortDescription="Withdrawal" toolTipText="CashWithdrawal" 
    mnemonic="C"/>

The system uses the value "Withdrawal_Op" as a key in the SampleResourceBundle class. The value paired with this key is used as the localized long description.

See Setting the locale for the Desktop and Supporting a language change in runtime.