Struts Tip #4 - Formatting output with MessageResources http://husted.com/struts/tips/004.html
also have a look at the Java Internationalization Tutorial's page http://java.sun.com/docs/books/tutorial/i18n/format/messageFormat.html
You can use this to specify the format for each language and substitute in the correct values at run time.
Jason Lea
David M. Karr wrote:
"Dolf" == Dolf Starreveld <[EMAIL PROTECTED]> writes:
Dolf> On a struts based JSP is need to output something like: Dolf> To do x, click <here> Dolf> <here> means that words needs to be a link. Without using resource (and Dolf> internationalization), it would look like:
Dolf> <P>To do x, click <a href="URL">here</a></P>
Dolf> Without internationalization 100% OK, it would become: Dolf> <P> Dolf> <bean:message key="click"/> Dolf> <html:link action="/clickAction">here</html:link> Dolf> </P>
Dolf> click=To do x, click
Dolf> The problem is that this is not fully localizable. In some languages the word Dolf> "here" would have to be in a different position. I do not want to have Dolf> different JSPs for each locale.
Dolf> I know I could make a custom tag to do this, but I am hoping somebody already Dolf> has a solution to this problem.
It's messy, but you could define your messages that contain links to have three pieces, being "before link", "link", and "after link". You could specify all three in your JSP page in the same way for every locale. Some locales would have all three pieces defined, but some locales might just have the "before link" and "link", and the "after link" would be empty.
If your locale-specific arrangements are any more complicated than this, then you should use different JSP pages for each locale. You might be able to get away with using a smaller include file for just the locale-specific part, and have the rest of the page just use resources and simple tricks like as described above.
-- Jason Lea Email: [EMAIL PROTECTED] Phone/Fax: +64 3 381 2907 Mobile: +64 21 040 2708 Address: 9a Tabart Street, Christchurch, New Zealand
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

