This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSP and the fly likes L18N question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "L18N question" Watch "L18N question" New topic
Author

L18N question

Michael J. Makunas
Ranch Hand

Joined: Mar 11, 2002
Posts: 37
The site I am working on is going multi-lingual so we're dealing with some L18N issues. Basically, we've put all the text in properties files and are using <fmt:message key="foo"/> to get the correct text. The problem is adding hyperlinks to the text. Depending on the language, the link may be in different parts of the sentance. We don't want to put mark up tags in the properties files. We could could do <fmt:message key="prelinkfoo"/><fmt:message key="foo"/><fmt:message key="postlinkfoo"/> but that too is a bit messy and will be a problem if the sentence has more than one link in it.

Any ideas?
Bart Allen
Greenhorn

Joined: Dec 19, 2003
Posts: 21
Are there certain words or word combinations that will always result in a hyperlink? If so, you could create a secondary file of these values and then write a generator that produced an xml file out of you base text property file and your app would look at the gen'd xml file instead of the properties file. Modifications to the base text files would require re-running of the generator.


SCJP, SCWCD, SCBCD, SCJD
Michael J. Makunas
Ranch Hand

Joined: Mar 11, 2002
Posts: 37
Originally posted by Bart Allen:
Are there certain words or word combinations that will always result in a hyperlink? If so, you could create a secondary file of these values and then write a generator that produced an xml file out of you base text property file and your app would look at the gen'd xml file instead of the properties file. Modifications to the base text files would require re-running of the generator.


Yeah, that is a possibility. But probably overkill for our situation. We don't have any sentences with more than one link now so the prefoo/foo/postfoo approach is probably best. We're not talking about a site with thousands of pages of text and links so a not so elegant solution will have to do for now. But this must be a fairly common problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: L18N question
 
Similar Threads
Properties file issue
Strange IllegalArgumentException: No bean specified
bean:message in a java class
Changed values aren't set on the backing object.
internationalization in JSTL