Project: Birt
Bug 194246 Internationalized messages do not work correctly when supplying arguments.
Reported: 2007-06-25 11:55:22 | Status: verified fixed

A call to: reportContext.getMessage( key, locale, arguments ) ...does not work as expected. The key is correctly internationalized, but the arguments are not. The attached report (with 2 .properties files) demonstrates this. It displays a message in English then in German. The correct output should be: Date in English: 01 October 2007 Datum auf Deutsch: 01 Oktober 2007 ...but instead it displays: Date in English: 01 October 2007 Datum auf Deutsch: 01 October 2007 In other words, the message has been translated, but the argument has not. I believe the root cause of this problem is in ReportContextImpl->getMessage( String, Locale, Object[] ). The code: return MessageFormat.format( msg, params ); ...should, I think, be something like: MessageFormat formatter = new MessageFormat( msg, locale ); return formatter.format( args, new StringBuffer(), new FieldPosition( 0 ) ); (Sorry, I'd submit a proper patch but I can't get the source code to compile. That's another story...)

Files changed in fix:
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/ReportContextImpl.java