4.13. Localization Settings

ReportServer contains localization settings in the /fileserver/etc/main/localization.cf file.

You can configure the languages available to your ReportServer users with the following:

	<locales>en,fr,de</locales>

In the example above, english, french and german languages are enabled. The default language can be configured with the following setting:

	<default>fr</default>

In the example above, only french will be auto-selected in the ReportServer language list. Note that for users that previously used ReportServer, the language they used is saved in a cookie for next time, so the default language setting will not have any effect on these users. You have to delete your browser's cookies for this.

You can find more information on the available language codes here: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Locale.html.

The country/region (note the uppercase) in which you are using your ReportServer can be configured as follows:

	<region>US</region>

This may be important when using currencies in your reports. For example, if your Jasper reports are executed using the ''DE'' (Germany) region code, their currencies will be printed in euro. If they are executed using the ''US'' region code, their currencies will be printed in dollars.

You can find more information on the available country/region codes here: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Locale.html.

Formats can be configured in the following:

<format>
	<!--
		<shortDatePattern></shortDatePattern>
		<longDatePattern></longDatePattern>
		<shortTimePattern></shortTimePattern>
		<longTimePattern></longTimePattern>
		<shortDateTimePattern></shortDateTimePattern>
		<longDateTimePattern></longDateTimePattern>
		<numberPattern></numberPattern>
		<currencyPattern></currencyPattern>
		<integerPattern></integerPattern>
		<percentPattern></percentPattern>
	-->
</format>

For example, the shortDatePattern and numberPattern may be configured as follows:

<format>
	<shortDatePattern>y-MM-dd</shortDatePattern>
	<numberPattern># ##0,00</numberPattern>
</format>

Details on the formats available may be found here:

The currency locales may be configured in the following section:

<currencies>
       <currency language="de" region="DE">currencyEuro</currency>
       <currency language="en" region="US">currencyDollar</currency>
       <currency language="en" region="GB">currencyPound</currency>
       <currency language="ar" region="AE">AED</currency>
       <currency language="ps" region="AF">AFN</currency>
       ...
</currencies>

In the example above, the Euro currency is localized to the de_DE locale. If you need to change this, e.g. to fr_FR, you may change this to:

<currencies>
       <currency language="fr" region="FR">currencyEuro</currency>
       <currency language="en" region="US">currencyDollar</currency>
       <currency language="en" region="GB">currencyPound</currency>
       <currency language="ar" region="AE">AED</currency>
       <currency language="ps" region="AF">AFN</currency>
       ...
</currencies>

As currency is locale-specific, the format may change depending on the locale configured here.

For example, 123456.79 dollars will be printed as follows in the default locale:

US$123,456.79

In en_US locale, the same will be printed as:

$123,456.79

Note that you have to restart ReportServer if you change your currency locale configuration.

More details on currency locales may be found here: http://www.gwtproject.org/javadoc/latest/com/google/gwt/i18n/client/NumberFormat.html.