If the NLS feature is enabled for a report or library component when it is designed in JReport Designer, it will also be available after the report or library component is published to JReport Server. Then when the report or dashboard that contains the library component runs in the client/server scenario, different clients can select different languages to render it.
JReport Server also provides administrators with the NLS Editor in the server console with which they can edit NLS for any report or library component the same as the report designer does in JReport Designer. JReport Server administrators can also create global NLS resources that can be shared by all reports and library components to reduce the translation cost.
The global NLS is similar to the local NLS feature. Local NLS is the NLS resource used for a particular report or library component, while global NLS is the NLS resource that can be used for all reports and library components in any catalog in both JReport Server and JReport Designer. With global NLS, you can share the NLS information between all reports and library components and reduce your translation cost. This feature is provided to administrators only.
To create global NLS on JReport Server:

above the Language box. The Select Language Source dialog is then displayed.NLS resource files should follow the naming rule: NLS_[language]_[region A2]_[User Defined].properties. The language argument is a valid ISO Language Code as defined by ISO-639. You can find a full list of these codes at a number of sites, for example: http://www.loc.gov/standards/iso639-2/php/code_list.php. The region argument is a valid ISO Country Code as defined by ISO-3166. You can find a full list of these codes at a number of sites, for example: http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html.
The specified languages are now displayed in the Language box in the Global NLS dialog.
to add a new row of display.

Select the type of the display from the Type drop-down list, which can be one of the following:
Then specify the key in the Key column and give the corresponding target language text in the Translation column. Click
to add more rows and specify the key and translation according to your requirements. To remove a display row, check it and click
.
If some of the text cannot be displayed when you run the report in the target language, change the font face and font size of the text in the Font tab.
to add a new row of format.

In the Key column, specify the format of the key in the original language, then in the Format column, specify the format of the key in the target language. Click
to add more rows and specify the format information according to your requirements. To remove a format row, check it and click
.
to add a new row of font.

In the Key column, choose from the drop-down lists the font face and font size of the key, in the Font Face column, choose from the drop-down list the font face for the target language, then in the Font Size column, choose from the drop-down list the font size for the target language or check to use relative font size so that the font size can be adjusted according to the font size setting of the web browser. Click
to add more rows and specify the font information according to your requirements. To remove a font row, check it and click
.
JReport allows you to edit NLS for each catalog, report, library component or dashboard as the report designer would with the NLS Editor in JReport Designer. With the NLS Editor, you can translate a catalog, report, library component or dashboard into different languages from the original one. This feature is provided to administrators only.
To edit NLS for a catalog, report, library component or dashboard on JReport Server:
on the floating toolbar. The NLS Editor appears.

above the Language box.
, then in the Add Display dialog, where all the display text in the catalog/report/library component/dashboard are listed, select the keys you want to translate and enter the target language text for the keys in the Translate column, then click OK. The selected keys are now listed in the Display tab of the NLS Editor. You can further edit the translation for the keys here if required. Click Add to Global NLS to add the display information you just specify to the global NLS library of the target language if you want to reuse them later. If some of the keys already exist in the global NLS library, the Add to Global NLS dialog appears for you to handle the duplication.
If some of the text cannot be displayed when you run the report/library component/dashboard in the target language, change the font face and font size of the text in the Font tab.
, then in the Add Format dialog, where all the formats used in objects of the catalog/report/library component/dashboard are listed, select the keys you want to customize and provide the target language format for the keys in the Format column, then click OK. The selected keys are now listed in the Format tab of the NLS Editor. You can further edit the format for the keys here if required. Click Add to Global NLS to add the format information you just specify to the global NLS library of the target language if you want to reuse them later. If some of the keys already exist in the global NLS library, the Add to Global NLS dialog appears for you to handle the duplication.
, then in the Add Font dialog, where all the fonts used in objects of the catalog/report/library component/dashboard are listed, select the keys you want to customize and give the target language font face and font size for the keys in the Font Face and Font Size columns, then click OK. The selected keys are now listed in the Font tab of the NLS Editor. You can further edit the font face and font size for the keys here if required. Click Add to Global NLS to add the font information you just specify to the global NLS library of the target language if you want to reuse them later. If some of the keys already exist in the global NLS library, the Add to Global NLS dialog appears for you to handle the duplication.Notes:
-Djreport.url.encoding=UTF-8 to the batch file that starts the server and then restart it. This changes the encoding to Unicode which supports all languages. JReport allows you to edit NLS for resources in the resource tree. With resource tree NLS, you can translate the names of all reports, library components and folders in the resource tree into different languages from the original one. This feature is provided to administrators only.
To edit NLS for resources in the resource tree on JReport Server:

above the Language box. The Select Language Source dialog is then displayed.NLS resource files should follow the naming rule: NLS_[language]_[region A2]_[User Defined].properties. The language argument is a valid ISO Language Code as defined by ISO-639. You can find a full list of these codes at a number of sites, for example: http://www.loc.gov/standards/iso639-2/php/code_list.php. The region argument is a valid ISO Country Code as defined by ISO-3166. You can find a full list of these codes at a number of sites, for example: http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html.
The specified languages are now displayed in the Language box in the Resource Tree NLS dialog.
When a new page is entered, the modifications you made on the last opened page will be saved automatically.
Notes:
When you have NLS enabled for a report or library component in the JReport Server console, or have an NLS report or library component published to the server from JReport Designer, you can then run the report or dashboard that contains the library component in the specified languages.
Before running a report or dashboard, make sure you have the Execute and/or Edit permissions on it when it's in a public folder in the server resource tree.
To directly run an NLS report/dashboard in a specified language:
To run an NLS report in a specified language in Advanced mode:
on the floating toolbar.To schedule an NLS report to make it run in a specified language:
on the floating toolbar.When you schedule to publish a report to HTML format, or run it in Advanced mode in HTML format, you can localize the names of page navigation links in the HTML report outputs, such as First, Previous, Next, and Last, according to your requirements.
The localizing process is divided into three steps:
Step 1: Creating the property file
To localize the page navigation link names in HTML report outputs, a property file must be created first for the desired language. To do this:
<server_install_root>\resources as follows: <server_install_root>\resources\report\languages\[language-locale]\properties. For example, C:\JReport\Server\resources\report\languages\zh-cn\properties.
Click here for more information about the naming criterion for language package folders.
|
Note: For the line "4000107=@CurrentPageNumber; of @TotalPageNumber;", you just need to translate "of" to the desired language. In the HTML outputs, @CurrentPageNumber will be replaced by the current page number, and @TotalPageNumber by the report total page number.
<jdk_install_root>\bin directory.
Note: You can just add the <jdk_install_root>\bin directory to your PATH instead of copying the file.
<jdk_install_root>\bin by running the following command:
C:\jdk1.8.0\bin>native2ascii -encoding utf-8 report.properties > newreport.properties
Note: When you convert your property file to the same directory as the original one, you need to give it a new name instead of replacing the original in order to avoid problems.
<server_install_root>\resources\report\languages\[language-locale]\properties and copy newreport.properties in <jdk_install_root>\bin to it, then rename the property file back to report.properties.Step 2: Enabling the language for the report
When the property file is ready, the next step is to enable the language defined in the file for the required report.
on the floating toolbar.
above the Language box, then in the Add Language dialog, choose the specified language and click OK.Now the language will have been enabled for the report.
Step 3: Applying the localized link names to HTML report outputs
or Schedule button
on the floating toolbar.