Internationalization support in CDF

Creating an dashboard for users in different regions can be hard in term of the message format for the local region. CDF provide internationalization support through Resource bundles that help internationalize our application.

To create resources file for i18n (there are 18 letters between the first i and the final n) we need to create a file for each locale our application supported. These files are named <name>.properties, or <name>_<language>.properties or <name>_<language>_<country>.properties. For instance a resource bundle for Locale.UK will be MessagesBundle_en_GB.properties. The <language> argument is a valid ISO Language Code. These codes are the lower-case, two-letter codes as defined by ISO-639. You can find a full list of these codes at a number of sites, such as: http://www.loc.gov/standards/iso639-2/englangn.html The <country> argument is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as: http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html

We have two level of messages files in CDF

To use the internationalization support you've to use the CDF.i18n tag with the following syntax:

CDF.i18n(<message_key>)

where <message_key> is a message key that can be found in one of the message resource bundle files located as explained above.

To enable Dashboard specific message files support add a <messages> element to the .xcdf dashboard configuration file whose value is the base name of the dashboard specific message file.

You can find a sample of a localized dashboard in the CDF samples section.