You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by David Just <da...@visionsolutions.com> on 2010/04/13 22:26:51 UTC
Adding translatable text to decorator
I need to be able to translate the text that I put into my decorator
(which is currently hardcoded into the header.vm/footer.vm files). Is
there a properties file that I can modify or where should I
add/configure a new properties file for my translatable text? How can I
access it from the header.vm/footer.vm files.
Thanks.
Dave
David Just l Senior Software Engineer l Vision Solutions l +1 (507) 529-5939 l david.just@visionsolutions.com
The contents of this e-mail (and any attachments) are privileged and confidential. Unauthorized use is strictly prohibited.
Re: Adding translatable text to decorator
Posted by Woonsan Ko <wo...@yahoo.com>.
Hi David,
In velocity templates, you could simply use the velocity tool, ResourceTool. [1]
You could add the tool definition in /jetspeed/WEB-INF/toolbox.xml like the following:
<tool>
<key>text</key>
<class>org.apache.velocity.tools.generic.ResourceTool</class>
<!-- default resource bundle as an example -->
<parameter name="bundles" value="org.apache.jetspeed.decoration.resources.DecoratorActions"/>
<!-- default locale -->
<parameter name="locale" value="en_US"/>
</tool>
The two parameters in the above are just optional and default resource bundle/locale settings.
And, you could refer the tool by the name 'text' and append the resource keys:
<p>$text.view</p> <!-- equivalent to bundle.getString("view") -->
Please refer to [2] for details on how to use. You can also load other resource bundles.
[1] http://velocity.apache.org/tools/releases/1.3/generic/
[2] http://velocity.apache.org/tools/releases/1.3/javadoc/org/apache/velocity/tools/generic/ResourceTool.html
Kind regards,
Woonsan
----- Original Message ----
> From: David Just <da...@visionsolutions.com>
> To: Jetspeed Users List <je...@portals.apache.org>
> Sent: Tue, April 13, 2010 10:26:51 PM
> Subject: Adding translatable text to decorator
>
> I need to be able to translate the text that I put into my decorator
(which
> is currently hardcoded into the header.vm/footer.vm files). Is
there a
> properties file that I can modify or where should I
add/configure a new
> properties file for my translatable text? How can I
access it from the
> header.vm/footer.vm files.
>
Thanks.
Dave
David Just l Senior Software Engineer
> l Vision Solutions l +1 (507) 529-5939 l
> ymailto="mailto:david.just@visionsolutions.com"
> href="mailto:david.just@visionsolutions.com">david.just@visionsolutions.com
The
> contents of this e-mail (and any attachments) are privileged and confidential.
> Unauthorized use is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org