You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Allen <da...@mojavelinux.com> on 2003/03/01 04:03:36 UTC

i18n in SimpleMenuItem

Has anyone written a class (which they would like to share) that
extends SimpleMenuItem to retrieve the bundle key for value and
global forward for the link?

I was envisioning something along the lines of:

<item name="webapp.page.news" value="news"
classname="org.apache.struts.titles.bean.SmartMenuItem"/>

I am not even interested in the global forward as much as the
bean:message bundle resource.

Also, while I am on the topic of tiles.  Is there any way to use the
<bean:message key="webapp.title"/> in the tiles definition file?  I
know that you can have different definition files for different
languages, but it would seem to be more logical to be able to
reference the application message bundle instead.  It would seem to
me a new "type" of message would be the most approrpriate if it is
not already possible to do this.

I would be grateful for any responses to those two inquires.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"I'm old enough to know better, but still too young to care."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: i18n in SimpleMenuItem

Posted by Cedric Dumoulin <ce...@apache.org>.
  Hi,

  The Tiles config files should contain the resource keys (<put 
name="title" value="a.key" />). You use this keys in the jsp file in 
conjunction with tags accepting such keys:
<tiles:importAttribute />
<bean:write name="a.key" />.

  You can implement your own SmartMenuItem, taking a key as input, and 
providing the translated value as output ... You should find a way to 
specify the resource bundle to use.

        Cedric


Dan Allen wrote:

>Has anyone written a class (which they would like to share) that
>extends SimpleMenuItem to retrieve the bundle key for value and
>global forward for the link?
>
>I was envisioning something along the lines of:
>
><item name="webapp.page.news" value="news"
>classname="org.apache.struts.titles.bean.SmartMenuItem"/>
>
>I am not even interested in the global forward as much as the
>bean:message bundle resource.
>
>Also, while I am on the topic of tiles.  Is there any way to use the
><bean:message key="webapp.title"/> in the tiles definition file?  I
>know that you can have different definition files for different
>languages, but it would seem to be more logical to be able to
>reference the application message bundle instead.  It would seem to
>me a new "type" of message would be the most approrpriate if it is
>not already possible to do this.
>
>I would be grateful for any responses to those two inquires.
>
>Dan
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org