• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Custom tag in ResouceBundle

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Imagine there's a JSP code like below:


and it will be expanded as below:


Now I want to I18N this.

If you write like:


and the ResouceBundle is like:


then this will be expanded as below:


As you see, the custom tag is never expanded.

If you write like:


and the ResouceBundle is like:


of course it will be expanded as below:


But this word-to-word strategy is not applicable to I18N because some languages have different sequence of words.

What's the best solution?

I don't want to have multiple JSPs for each language.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I am aware, it is not possible to produce JSP markup and have it interpreted in this manner - ie your <k:span> tags.
Those tags need to be in there at the time of jsp translation/compilation. They won't be evaluated if you output them via your JSP Writer.

So if I understand your purpose here, you want to apply markup tags to i18ned text.
Not a trivial thing.

The only approach that that even sounds remotely feasible is for you to write your own message tag, that would retrieve the translation from your message bundle, apply some custom logic to evaluate/expand that retrieved message, and then output it to the JSP.

No, its not standard at all, but it might be the only solution.


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic