Jump to content

Internationalization


sefas

Recommended Posts

I can't it to work, but maybe I have misunderstood.

 

I have a default properties file MyReport.properties containing

 

# Locale for report MyReport.jrxml

text.Date=Date

 

Then in my report I have a Static text field that contains

 

str("text.Date")

 

But when I run the report the text is displayed as

str("text.Date") instead of Date

 

What am I doing wrong?

 

ireport version is 1.2.2

Link to comment
Share on other sites

  • 1 month later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 10 months later...

jasperNoob wrote:

you cant use static text ... you got to use a textfield and that too u have to transform into $R{text.date} . Only then will it look for the translation in the resource bundle.

It isn't surprising that people make this assumption when the iReport documentation CLEARLY states:

JasperReports 0.6.2 introduced some new features for report internationalization. Internationalizing
a report means making all static text set at design time (such as labels and messages)
adaptable to locale options used to build the report: the report engine will print the text using the
most appropriate available translation.

Which does rather more than imply that staticText fields ARE i18n'ed during report generation.

 

To have to use a textField to get i18n is rather untidy...

Link to comment
Share on other sites

  • 3 weeks later...

There is a easier way to achieve this. What you need to do is to right click on the Static text field and select the option "Transform in TextField" which will keep you formatting intact and yuou can achieve the behaviour of lacalization.

 

Let me know if you need further inputs.

Link to comment
Share on other sites

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...