• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

i18n custom tag

 
peter cooke
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for a custom tag that will help me with internationalization.

I want the tag to get the bundle based on bundle name and locale. Then it should look up the key in the bundle, create a MessageFormat object, and return the result from running the format method.

Please tell me there exists some public tag that can do this common thing.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSTL 'fmt' class of tags does exactly what you are after.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Jakarta implementation of the JSTL is available from the sidebar of this page.

Be sure to get the right version for your version of JSP: JSTL 1.0 for JSP 1.2, or JSTL 1.1 for JSP 2.0.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example usage:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic