BIRT reports support localization and internationalization. Please follow the below steps to localize your BIRT report. When creating your BIRT Report also create corresponding.properties files in the same location. See naming convention section below.
- Create report with corresponding default.properties file. These are the 2 files you will deliver e.g.
- SampleWithTextLocalised.rptdesign
- SampleWithTextLocalised.properties
- Run the client.birt command to publish these properties files so they are available to BIRT Eclipse.
- In Report Designer open the report you wish to localize.
- In the layout pane of the report click anywhere on the white space. Go to the Properties section and click on Resources.
- In the Resource file field click browse select the appropriate.properties file from the Properties folder.
- For each label, go the Localization tab in the Property Editor and choose the appropriate resource from the list for the Content key property.
- Test the report in BIRT Eclipse Click on the menu->Preferences->Report Design->Preview and choose your locale. Click ok and run the report. It should display the text for the corresponding locale you have chosen.
- Test the report running in Tomcat - When running report append the following parameter to the end of the report URL &__locale=en / &__locale=en_US / &__locale=de_DE.
- E.G. MyReport.rptdesign&__locale=en_US
- These.properties file names should follow the convention "ReportName_lang_country.properties", where lang and country are two-letter ISO codes. For example for German translation use "myreport_de_DE.properties", for US English use "myreport_en_US.properties".
- The ".properties" files must be ASCII encoded. All characters with codes above 127 ASCII must be escaped using this pattern: \uNNNN, where NNNN is the four-hex-digit Unicode representation of the original character. In theory you could escape all characters, but really it is not needed for those under 128 ASCII.
- The contents of the properties files should follow standard BIA naming conventions:
- Help.PageDescription=This page allows you to add a text translation to a localizable text record. A localizable text record allows for application text to be localized.
- PageTitle.StaticText1=Add Text Translation.
- ActionControl.Label.Save=Save.
- ActionControl.Label.Save.Help=The Save action updates the record using the information entered on the page.
- ActionControl.Label.Cancel=Cancel.
- ActionControl.Label.Cancel.Help=The Cancel action dismisses the page.
- Cluster.Title.Details=Details.
- Field.Title.Language=Language.
- Field.Title.Language.Help=The language type for the text translation e.g. en, en_US.
- Field.Title.Text=Text.
- Field.Title.Text.Help=The actual translated text.
- Report.Title = Title of Report
- Report.chart.xaxis.title = X-axis title, e.g. time
- Report.chart.yaxis.title = Y-axis title, e.g. no. of people participating
- Report.chart.title = Title of Chart.
- Report.chart.yseries1 = Series 1 of Y-values for comparing multiple rows