How to localize reports

0

Could someone tell me how can I localize my reports?

I would like to translate my column header etc. from english to other leangues.

 

kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago

13 Answers:

0

Hello,

 

Here is a complete tutorial about localization.

http://www.jaspersoft.com/jasperserver-and-ireport-internationalization

The last part talk specifically about localizing reports

 

Hope this helps

Guillaume

gautier's picture
390
Joined: Oct 15 2008 - 7:09am
Last seen: 4 years 5 months ago
0

Hi,

 

thanks.

I have created a new Resource Bundle in iReport as name: hu

After I have uploaded to Resources folder, near to the report.jrxml on the JAsperserver.

I have set at the report properties-> Resource Bundle parameter : hu

I have uploaded the modified jrxml as well.

In the detail header I have set the Text value: $R{Date}

In the hu.properties I have: Date=Datum, but it does not translate it it shows: $R{Date} as columnheader.

 
 



Post Edited by kuzman at 12/08/2009 10:16



Post Edited by kuzman at 12/08/2009 10:22



Post Edited by kuzman at 12/08/2009 10:42
kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago
0

Hello

Have you add the ressource on the repository as well ?

(see step 4,5,6 from internationalize report)

Guillaume

gautier's picture
390
Joined: Oct 15 2008 - 7:09am
Last seen: 4 years 5 months ago
0

yes of course.

It is working with textField and not with static text.

When I make several leangue files, how can I select witch one will be used at current report? By report parameter or how?



Post Edited by kuzman at 12/08/2009 12:45
kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago
0


This feature is not supported by static text as they do not understand expresion. You must use text fields

 

Guillaume



Post Edited by gautier at 12/08/2009 14:55
gautier's picture
390
Joined: Oct 15 2008 - 7:09am
Last seen: 4 years 5 months ago
0

When I make several leangue files, how can I select witch one will be used at current report? By report parameter or how?

kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago
0
resource bundle names are similar used to java resource bundle name which is

{base name}_{language code}_{country code}.properties

the {base name} needs to be set within the report.

for each localization a matching bundle needs to exist.

here an example:

base name is set to messages.

for the default locale just deploy a file messages.properties. for language specific settings you need: for german language support a file messages_de_DE.properties would need to exist, for a french bundle you will need a file messages_fr_FR.properties.

the current report locale is defined by JasperServer, the locale the user has chosen while login.
mrcaffeine's picture
1248
Joined: Nov 10 2008 - 3:38am
Last seen: 2 years 6 months ago
0

Oke I understand the file names.

Our application definine the language during the login there is a language selector. In that case the applicaiton should set the actual language. In that case with witch parameter could I force the JAsperserver to use the selected language file?



Post Edited by kuzman at 12/08/2009 15:46
kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago
0


Hi,

 

You can use the REPORT_LOCALE parameter in your reports and sets it to the language you wish to use

 

Guillaume

gautier's picture
390
Joined: Oct 15 2008 - 7:09am
Last seen: 4 years 5 months ago
0

alternatively the parameter can be taken from the session

mrcaffeine's picture
1248
Joined: Nov 10 2008 - 3:38am
Last seen: 2 years 6 months ago
0

I have put the hungarian to the application-security.xml..

Thanks.



Post Edited by kuzman at 12/09/2009 09:32
kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago
0

Hi

The localization is working well.

Currently I have uploaded the resource bundles translation files under the report's resource.

Is it possible to copy them to one global space? All reports can use the same translation files and I do not need copy them under every report resource.

kuzman's picture
60
Joined: Mar 9 2009 - 4:46am
Last seen: 5 years 10 months ago
0
Guillaume, I tried setting an input control in the repository for REPORT_LOCALE, and set its value to "fr_FR" (of which I have bundle for), but when the report is ran I still have "en_us" which is being read from my browser and the value does not get changed. Can you show an example of the code you use to assign the REPORT_LOCALE a new value, I would really like the users to be able to change their locale at Report Runtime, rather than at Login. Thanks.
ronedog's picture
38
Joined: Apr 16 2010 - 8:46am
Last seen: 9 years 8 months ago
Feedback