Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes i18n of a string with a number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "i18n of a string with a number" Watch "i18n of a string with a number" New topic
Author

i18n of a string with a number

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

I am creating a website that does searches for something
in a form (in JSP) and returns a list of found items.
I want to localize the string "Found X items" in a taglib.
Can anyone brainstorm on how to do this ?
Firstly passing in the number is mandatory.
Maybe, e.g
<foundCount num="4"/>
The taglib will read the locale from web.xml.
The difficult part (to me) is how do you translate
"found x items" to other languages as all have different
structure. In another language, it could be:
4 <items> <found>
or
<item> 4 <found>
or whatever syntax the language dictates.
Thanks
Pho


Regards,

Pho
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

i found it myself. see java.text.MessageFormat.
Thanks to myself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i18n of a string with a number
 
Similar Threads
List Objects in Form Bean has null values...mostly
please help
Example of AT_BEGIN
PLGN0021E: Servlet Request Processor Exception
JSTL choose not executing as expected