• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom tag in ResouceBundle

 
Kuniyoshi Kamimura
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
 
Stefan Evans
Bartender
Posts: 1784
10
  • Mark post as helpful
  • send pies
  • 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.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic