• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

L18N question

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Michael J. Makunas
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic