Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Internationalization of HTML Button(How to add translations to a "HTML Button" Report Item)
icon5.gif  Internationalization of HTML Button [message #1602085] Thu, 05 February 2015 10:06 Go to next message
Stefan Seitz is currently offline Stefan SeitzFriend
Messages: 14
Registered: February 2015
Junior Member
I am using a Report Item "HTML Button" in my BIRT Report design, but don't find a possibility to get the Button's Text (Value) translated.
I would be happy about any suggestions.

That's the version I'm using:
Actuate BIRT Designer Professional
Version: 4.2.3
Build id: v20131216

Thanks in advance
Stefan
Re: Internationalization of HTML Button [message #1604532 is a reply to message #1602085] Fri, 06 February 2015 23:18 Go to previous messageGo to next message
Jesse Freeman is currently offline Jesse FreemanFriend
Messages: 184
Registered: January 2015
Senior Member
Changing the localization text on an HTML Button is looking to be tricky. I'm working on seeing what can be done.
As an alternative, you can create the buttons manually using a text element an adding the HTML code to create a button. Then you can use the key value properties file localization settings in BIRT to modify the value of the button when it is rendered.
Re: Internationalization of HTML Button [message #1610119 is a reply to message #1604532] Tue, 10 February 2015 15:16 Go to previous messageGo to next message
Stefan Seitz is currently offline Stefan SeitzFriend
Messages: 14
Registered: February 2015
Junior Member
Jesse,
Thanks for your reply. This seams really to be something tricky to get - has anybody had that problem before?
Currently it looks like I have to follow your suggestion and add the button in a text element.
Regards - Stefan
Re: Internationalization of HTML Button [message #1610405 is a reply to message #1610119] Tue, 10 February 2015 19:37 Go to previous messageGo to next message
Jesse Freeman is currently offline Jesse FreemanFriend
Messages: 184
Registered: January 2015
Senior Member
I've personally not worked with anybody trying to add localization to the text of an HTML Button element.
I'll see if I can figure out another way but it's looking like the text element suggestion is going to be the easiest implementation.
icon3.gif  Solution found [message #1611534 is a reply to message #1610405] Wed, 11 February 2015 12:31 Go to previous message
Stefan Seitz is currently offline Stefan SeitzFriend
Messages: 14
Registered: February 2015
Junior Member
Yeah, I found a solution:
I have tried the text element -> including a Button, but that would not work for me, as the function behind would require the "this" element of the report....
What I did is: a javascript generates the HTML Button's name.
I am using a helpers.js what is included in the report as ressource. In there I have a function called msg_for() which looks like this:
function msg_for(prop) {
	// look msg for property prop.
	// if nothing is found the last part of the prop is returned.
	
	var msg = reportContext.getMessage(prop, reportContext.getLocale());
	if (msg == null || msg == '' || msg == undefined) {
		if (prop != null) {
			var lidx = prop.lastIndexOf(".")+1;
			msg = prop.substr(lidx);
			} else msg = prop;
		}
	return msg;
}

So, the "Value" field of the HTML Button is:
msg_for("message_Name_In_Properties_File")
Previous Topic:&amp in PDF
Next Topic:Sankey diagram
Goto Forum:
  


Current Time: Fri Apr 26 06:23:58 GMT 2024

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

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

Back to the top