Overview of the localization process
The localization processes are similar for BIRT reports and for Java applications. This section provides an overview of the entire process. The steps that you perform using BIRT Report Designer are described in more detail in later sections. The basic steps are as follows:
*Create the default resource file. The resource file is a text file with a .properties file-name extension. In this file, define all the resource keys in key=value format, as shown in the following examples:
hello=Hello
thanks=Thank you
If you know the text strings that you want to localize, you can create the resource file in an external text editor and define the keys before building a report. Alternatively, create the resource file in BIRT Report Designer and define keys as you add label and text elements to the report.
*If you created the default resource file in an external text editor, place the file in the resource folder. If you create the resource file in BIRT Report Designer, the file is created in the resource folder. You specify the location of the resource folder in the Preferences page, which you access by choosing WindowPreferences from the main menu, then choosing Report DesignResource.
*Assign the resource file to the report that you want to localize.
*For each report parameter, label, text, or chart element to localize, choose the resource key to use.
*When you finish defining the keys in the default resource file, create a resource file for each language that the report will support. The file name must include the language code and, if necessary, the region code. The file name must be in the following format:
<filename>_<ISO 639 language code>_
<ISO 3166 region code>.properties
For example, MyResources_en_US.properties is for U.S. English, and MyResources_en_UK.properties is for British English. For a list of supported language and region codes, see the Java reference documentation at the following URL:
http://www.oracle.com/technetwork/java/index.html
*In the localized resource files, use the same set of keys that are defined in the default resource file, and set their values to the translated strings. A quick way to create the keys is to make a copy of the default resource file, then edit the values. Unless you are multilingual, this task is typically done by a team of translators.
The following examples show resource keys and values that could appear in two localized versions of the same information:
MyResources_fr.properties:
hello=Bonjour
thanks=Merci
MyResources_es.properties:
hello=Hola
thanks=Gracias
*Use the native2ascii command to convert the localized resource files to a format that the Java platform can use. The command requires an input file name and an output file name, so copy the resource file to a temporary file, then use the correct file name as the output file name.
The following example converts a Japanese resource file:
copy MyResource_ja.properties temp.properties
native2ascii -encoding SJIS temp.properties
MyResource_ja.properties
For more information about native2ascii and the list of supported encoding character sets, see the Java reference documentation at the following URL:
http://www.oracle.com/technetwork/java/index.html
*Place all the localized resource files in the resource folder. When a report runs, BIRT uses the appropriate resource file to find the localized text values to display. If BIRT cannot find a resource file for a specific locale, it uses the default resource file.