I'm not getting the parameter substitution to work correctly.
Resource:
message.benefits=The FedEx Custom Critical&nbsp;<a href="{0}">Shipping 
Toolkit</a>&nbsp;enables you to:
I've tried two different methods to perform the substitution.

<fmt:message key="message.benefits">
  <fmt:param value="<bean:message key="href.shippingToolkit"/>"/>
</fmt:message>

and

<bean:define name="stLink" scope="page">
  <bean:message key="href.shippingToolkit"/>
</bean:define>
<fmt:message key="message.benefits">
  <fmt:param value="stLink"/>
</fmt:message>

But both end up creating a URL like:
https://localhost:7002/track/tiles/{0}

If I hard code it like this
<fmt:message key="message.benefits">
  <fmt:param value="/us/shipping/default.shtml"/>
</fmt:message>
it works fine, so I know the param substitution itself is working, just not the 
substitution from the resource file.

-----Original Message-----
From: Evan Schnell [mailto:[EMAIL PROTECTED]
Sent: Friday, October 10, 2003 17:10
To: Struts Users Mailing List
Subject: Re: ugly ugly ugly


David Graham wrote:

 From my experience working with human translators this might be a 
better approach.  Translators like to be able to manipulate word order 
and punctuation. 
It is a little more code but I'll argue that it is not any less 
readable. Most importantly it works with Struts links and will properly 
encode the URL:


applicationResources.properties:
message.benefits=The FedEx Custom Critical&nbsp;{0}&nbsp;enables ...
mainPage.shippingLinkName=Shipping Toolkit


Put this at the top of the JSP:
<fmt:setBundle 
basename="com.nvisia.training.struts.resources.ApplicationResources"/>
<bean:define name="stLink" scope="page">
    <html:link action="/shipping">
       <bean:message key="mainPage.shippingLinkName"/>
    </html:link>
 </bean:define>

In the body of the jsp:
<fmt:message key="message.benefits">
     <param value="stLink"/>
</fmt:message>


Regards, Evan.

-- 
Evan Schnell, Project Lead
nVISIA, Twin Cities  "Enterprise Architecture and Construction"
7701 France Ave. S, Edina, MN 55435
Voice: 952.837.2577 -- Fax: 952.837.2578 -- Mobile: 612.232.5972


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to