Jinfonet Home > Newsletter > Tech Tip > Native Language Support in the Application Level
 

Native Language Support in the Application Level

In JReport Enterprise Server, a "resources" folder is added to the installation root directory and it is used for holding language packages. Each language package contains all the UI text and messages available in JReport Enterprise Server and JReport Web as well as translated versions to one or more specific languages. When a language package is applied, the JReport Enterprise Server and JReport Web UI will be displayed in the language specified in that package.

In each language package, there are three properties files which together contain all the UI text and messages in JReport Enterprise Server and JReport Web:

  • common.properties
    This property file stores UI text and messages used by both JReport Enterprise Server and JReport Web in the specific language.
  • dhtml.properties
    This property file stores UI text and messages used by JReport Web in the specific language.
  • server.properties
    This property file stores UI text and messages used by JReport Enterprise Server in the specific language.

Specifying the application language

Once the application language is set, it takes effect in both JReport Enterprise Server and JReport Web. There are two ways of setting the application language:

1. Specifying by UI option

The Specify Default Language option allows an administrator or end user to switch the application language. The available language list depends on the language packages in <install_root>\resources\server\languages.

  • For administrators: Go to JReport Administration Page > Preferences > Customize > Advanced tab to set the default application language for all users.
  • For end users: Go to JReport Console Page > Preferences > Customize > Advanced tab to set an application language for themselves.

2. Specifying by URL parameter

End users can control the application language by using the "jrs.language" parameter when accessing JReport Console Pages or JReport Web UI via URLs. The format of the URL is as follows:

http://IP_Address:port/context/pagename?parameter=value&jrs.language=Language_Name

The value of jrs.language should be the same as the language package folder name in the <install_root>\resources\server\languages directory and be lower-case letters.

The following are two examples:

  • URL for accessing JReport Console page:
    http://127.0.0.1:8888/jinfonet/normalIndex.jsp?jrs.language=zh-cn
  • URL for opening a report set in the DHTML format in JReport Web UI:
    http://127.0.0.1:8888/dhtmljsp/dhtml.jsp?jrs.cmd=jrs.try_vw&
    jrs.report=/SampleReports/AnnualSalesbyCustomerName.cls&
    jrs.catalog=/SampleReports/SampleReports.cat&
    jrs.cat_version=1&
    jrs.path=/SampleReports/AnnualSalesbyCustomerName.cls&
    jrs.result_type=8&
    jrs.language=zh-cn

Note: The specified application language by URL parameter has higher priority than that specified by UI option, and takes effect only in the current user session.