Monday, September 24, 2007

Internationalization

Now that our data and presentation layers are synced up through our generic schema, let's look at how internationalization fits into the picture. Labels can be assigned values in locale-specific properties files as name/value pairs. Our labels will coincide with our generic schema by being named Cat1Label, Date1Label and Val1Label. Just add "Label" to the end of the generic field names in our schema that's described in Step 1. For example, in a Sales_en_US.properties file referenced in a BIRT design we have:

Cat1Label=Customer
Date1Label=Transaction Date
Val1Label=Product Quantity

while in a Sales_fr.properties file we would have:

Cat1Label=Client
Date1Label=Date de Transaction
Val1Label=Quantité de Produit

The labels are referenced in your report designs as externalized text from these properties resource files. They are used for column headers, chart axis labels and titles in your report designs. The name/value pair combination associate the appropriate value to the label reference.

Here is a screenshot of setting the x-axis label in a BIRT chart to some external text associated with Date1Label:



The properties files can be referenced through the BIRT report design Resource File setting:

Enlarge

Notice how the Resource File setting identifies the properties file as Sales. Depending on what locale is being used, BIRT will serve up the name/value pair from the appropriate locale-specific properties file. In our example, this would be either Sales_en_US.properties or Sales_fr.properties.

No comments: