Jump to content
Changes to the Jaspersoft community edition download ×

i18n of reports


Recommended Posts

By: Axel Hallez - ahallez

i18n of reports

2003-04-03 06:08

Hello,

 

I am in the process of internationalising my application. The UI already uses resource files to load the localized strings. Now I would like to change the reports.

I've seen some posts about this topic, and I would like to add my 2 cents.

 

In my opinion, it is not a good idea to look up the localized strings via the datasource, since I see the datasource as part of the application logic and the localized strings as part of the UI.

Another reason against is the reuse of datasource code. I use one datasource class for many different reports and every report has it's own resource file(s). Mixing up these two would mean that the resource bundle has to be passed from the report to the datasource.

 

Here is my proposal:

- add a resourcebundle attribute to the jasperreport element.

- introduce a special code for adding localized strings like $L{title}.

AND/OR

- introduce a localized type of the static text element (which would no longer be really static of course).

 

I hope this sounds reasonable,

 

Axel Hallez

 

 

 

 

 

By: Edgar Dollin - edollin

RE: i18n of reports

2003-04-03 10:02

I was putting java code to do the I18N stuff.

 

The way struts works is more like the second option, i.e. <bean:message key="my.key" />. They look for a file applicationresources<locale>.properties. The default file is with no locale. Additionally, they give the option of specifying additional bundles although that is not necessary.

 

It would be nice if whenever there was static text, jasper went out to the resource file and if the text was a key, then use the information.

 

Additionally, there would have to be a way to pass in the users locale information.

 

Thanks.

 

Edgar

 

 

 

 

By: Edgar Dollin - edollin

RE: i18n of reports

2003-10-22 18:32

Are you going to be submitting patches?

 

My solution is to have a harness application in which runs jasper. The harness uses xml to store parameters and defaults (allowing for users to customize reports). Additionally it has a struts interface.

 

The code which sets the report parameters from the xml also passes in I18N parameters (it peruses a properties file and copies in a section of the I18N properties). Then you access them as standard parameters.

 

If there is any interest in this jasper-struts tool, let me know and I'll jar it up and submit it.

 

Edgar

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...