Localizing Report Elements

Users of InetSoft's reporting software are able to localize report elements in order to suit regional or international preferences. View the example below to learn more about the Style Intelligence solution.

Most text elements in a report, as well as data source names, data model names (entity/attribute), and query (column) names, can be localized via a simple text mapping.

The first step in setting up localization for a particular report is to assign Text IDs to each report text element that will be mapped. You can do this from within the 'Localization' window of the Report Designer.

Once Text IDs have been assigned to report elements, you can create the mapping file (“resource bundle”) that specifies the text substitutions for these elements. The mapping file should be given the name

SreeBundle_{language}_{country}.properties

#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index Read More

where {language} and {country} are the ISO-standard two-letter codes for language and country. For example, the localization mapping file for Canadian French speakers should be called 'SreeBundle_fr_CA.properties'. All report localization (“SreeBundle”) files must be available on the classpath, preferably in the sree/WEB-INF/classes directory. If the appropriate mapping file for the user's locale selection cannot be found at runtime, no localization is performed.

demo
Read how InetSoft saves money and resources with deployment flexibility.

Similar to the “srinter” files for Portal interface localization, each line of text in the report localization file has the following format:

{report_element_id}={translated_report_element_id}

The {report_element_id} is the Text ID assigned to the report element in the Report Designer. Spaces in the {report_element_id} must be escaped by a backslash, for example, 'Head\ 1'.

The {translated_report_element_id} is the translated text that you want to appear in the corresponding report element. Spaces in the {translated_report_element_id} do not need to be escaped.

For example, the French Canadian localization file mentioned above, 'SreeBundle_fr_CA.properties', might contain the following lines of text, where, for purposes of illustration, “State_fr” is used as the French translation of “State,” and so on:

title=Localized Report_fr

state\ header=State_fr

sales\ header=Sales_fr

The above mapping renames the three report text elements with the specified mock French text. The following example illustrates the use of a similar mapping that also translates data source names.

why select InetSoft
“We evaluated many reporting vendors and were most impressed at the speed with which the proof of concept could be developed. We found InetSoft to be the best option to meet our business requirements and integrate with our own technology.”
- John White, Senior Director, Information Technology at Livingston International

In this example, you will configure a report for French Canadian localization.You will also localize a data source name and a query name.

1. Open the Report Designer, and create a blank tabular report.
2. Add a text element with the text 'Report Title'. Format the text as desired.
3. Add a table, and bind it to the 'Orders' > 'sales by state' query.
4. Add a bar chart, and bind it also to the 'Orders' > 'sales by state' query. In the Chart tab of the 'Data Binding' dialog box, add 'State' on the X-axis and 'Sales' on the Y-axis.

We now have a report with three elements, and will assign Text IDs to several of the text components provided by those elements.

5. Open the 'Localization' dialog box from the Report Designer's 'Edit' menu.
6. Expand the component tree to view the text components which can be assigned Text IDs
7. Enter the following IDs in the 'Text ID' field for the corresponding components.

text1: report title
State: state header
Sales: sales header
X Axis Title: X
Y Axis Title: Y

Leave the Text ID box empty for the remaining elements.

8. Save the report, and deploy it to the Repository under the name 'Localization_Exp'.

You now have a deployed report with elements configured for localization. To enable localization to take place when the report is viewed, you must create the resource bundle that translates the assigned Text IDs into the desired text for the French Canadian locale.

9. Create a text file called 'SreeBundle_fr_CA.properties', and insert the following text:

report\ title=Localized Report_fr
state\ header=State_fr
sales\ header=Sales_fr
X=Sales By State_fr
Y=Revenue_fr Orders

=Orders_fr All\ Sales=All Sales_fr

Note that the final two lines of the mapping file specify a translation for the 'Orders' data source and the 'All Sales' query.

gallery icon
View the gallery of examples of dashboards and visualizations.

10. Save the file in the sree/WEB-INF/classes directory.

With the report elements assigned text IDs, and the resource bundle file appropriately named and placed on the classpath, you now need to register the locale in the Enterprise Manager.

11. In the 'Localization' page of the Enterprise Manager, add a new locale and specify 'fr' and 'CA' for the language and country codes, respec­tively. Set the 'Locale Label' to “French (Canada)”.

When the user now logs in and specified 'French (Canada)' in the 'Locale' login menu, they will view the 'Localization_Exp' report with the desired localization applied. The report title, table column headings, and chart labels have all been translated as specified.

Because the mapping file also specifies translations for a data source and query, if the user opens the 'Data Source' dialog box from within the Ad Hoc tool, they will see the specified translations for the 'Orders' datasource and the 'All Sales' query.

Previous: Localizing the Report Interface