Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » reportContext.getMessage() syntax to behave like label/chart localization properties
reportContext.getMessage() syntax to behave like label/chart localization properties [message #985750] Thu, 15 November 2012 23:04 Go to next message
Tom Yamada is currently offline Tom YamadaFriend
Messages: 12
Registered: July 2009
Junior Member
This concerns an issue I am seeing in an application using BIRT 2.5.2.

The labels and chart series titles are set by property keys and translate correctly. However the places where the design is using reportContext.getMessage("keyval") are not translating.

It appears that this is happening in cases where the browser is using one locale while the server is using a different one. The internal calls are getting the browser locale and are appearing correctly, while the JavaScript calls are using the server locale and are thus not correct.

I've done some searching and see that the getMessage() call accepts a second argument which is a locale. Since the browser locale is being used in the label localization I expect that the desired locale is available for use in code.

Is this what is returned by the reportContext.getLocale() call? I do not have access to a test environment to test this myself or I would! Thanks.
Re: reportContext.getMessage() syntax to behave like label/chart localization properties [message #985757 is a reply to message #985750] Thu, 15 November 2012 23:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Tom

It should be using the same locale. Any chance you could try setting the url parameter __locale? You should be able to get the locale in script like:
request = reportContext.getHttpServletRequest();
rLocale = request.getLocale();
var mytext = reportContext.getMessage("text1", rLocale);

Jason
Re: reportContext.getMessage() syntax to behave like label/chart localization properties [message #985759 is a reply to message #985757] Thu, 15 November 2012 23:42 Go to previous message
Tom Yamada is currently offline Tom YamadaFriend
Messages: 12
Registered: July 2009
Junior Member
Jason, thanks for the quick reply.

I did think that it was odd that the behavior was different as I expected that the vanilla method behavior would match the internal one.

I don't know if the application is sending a __locale parameter or not -- I don't have access to the environment to test, but could make the change in the design and send it back for them to test, just want to avoid too many such iterations. Smile
Previous Topic:Avoid Color in Series Palette
Next Topic:Real time charts
Goto Forum:
  


Current Time: Thu Apr 18 23:04:25 GMT 2024

Powered by FUDForum. Page generated in 0.01703 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top