Introduction
Internationalization is quickly becoming a growing requirement for many companies as they expand their offices to various locations around the world. Many companies are searching for a robust BI platform with multi-language support. This tutorial will identify various areas within the Jaspersoft Business Intelligence suite that utilize internationalization.
Note: To follow along with the example scenario, download the sample files located here.
Objectives
This guide will enable you to:
- Understand the 'bundles' concept
- Modify TIBCO JasperReports® Server bundle (to upgrade a translation)
- Implement a new language
- Internationalize Domains
- Internationalize reports
Pre-Requisites
Install the TIBCO JasperReports Server samples on your TIBCO JasperReports Server installation.
Understanding the 'Bundles' Concept
The concept of internationalization is the same across TIBCO JasperReports Server UI, reports, and Domains. In order to understand the concept of internationalization, first review the concept of bundles, which is a key building block.
Name_Suffix.properties
Notes:
|
Modifying TIBCO JasperReports Server Bundles
Locale bundles that use Unicode, accents or special characters have to be coded like \u00e0 for à.
Implementing a New Language
To implement a new language, copy all default bundles and rename them using the country code of your new language.
Example: In this example we will be defining translations for Danish. The country code is da (alpha-2 code).
Step | Action |
1 | Go to the …\jasperserver-pro\WEB-INF\bundle directory, and open the file: adhoc_messages.properties |
2 |
Rename (use Save As) the file to: adhoc_messages_da.properties Edit the file as follows in the image below: |
3 |
Create a new entry for your language:
|
Internationalizing Domains
Prior to internationalizing Domains, you first want to finalize and publish the Domain to JasperServer. In general, translations are typically defined once the Domain is complete and validated.
Example: We create the default translation and the French translation for a Domain.
Step | Action |
1 |
|
2 |
|
3 |
Launch the Domain Designer
|
4 |
The initial export will serve as the default translation. Additionally, we will define a French translation. Example: Translate the bundle into French and save it as employee_domain_fr.properties |
5 |
Publish the translation to TIBCO JasperReports Server:
|
6 | Select Resources breadcrumb at the top of the screen, and then click Add Local Bundle |
7 |
|
8 | Redo Step 7 for the file employee_domain_fr.properties |
9 |
Check your results:
Note: Make sure to specify the appropriate locale. |
Internationalizing Reports
Internationalizing Reports follows the same concept as internationalizing Domains. All labels that need to be translated are declared: $R {key_name}
Once the layout of the report has been finalized, create a bundle containing all the keys and their values (translations).
Example: We translate a report to French.
Step | Action |
1 | Open iReport |
2 |
Create a new empty report.
|
3 | Publish the report using the JasperServer plugin. |
4 |
Once the report is published, open the report unit, right click on the Resources folder, then choose Add > Resource Bundle |
5 |
Complete the Import Resource screen the form as follows; ensure you provide the full name. |
6 | Repeat this for all languages using the example: localereport_fr.properties |
What's Next?
Resource for searching all language codes is here.
Tip: Select by alpha- codes.
Written By
This tutorial was written by Guillaume Autier, Sales Engineer, June 2009
Log in or register to post comments