Bryan,

Here's some thoughts:

- Leverage the Java language's inherent ability to internationalize things.
- Leverage commons-resources to internationalize things.
- Use a database to internationalize things.


They aren't necessarily mutually-exclusive options, although there's little reason to use the first if you're using the second. The third can be a very powerful option, if you build your database in such a way that it allows you to store your text in different languages. Put a dozen programmers in a room and you'll come up with 20 different ways to do that - all of them better than the other, depending upon the requirements at hand. I'll leave determining a method as an exercise to you.

What I'm trying to say, and probably doing an exceedingly poor job of is that the view really should just display data. Your model, invoked through your actions, should determine the apropriate data to hand over to the view. Beyond that, it's really moot how you do it. My personal tendency is to use some sort of resource bundle, commons-resources or other, to handle the "static" items, and to handle a database for dynamic ones.

Google "Java i18n", "Java internationalization", or visit jakarta.apache.org/commons/resources for the static approaches.

Good Luck!

Eddie

----- Original Message ----- From: "bryan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 14, 2004 2:10 PM
Subject: Localize a dropdown select list



Is this possible with struts ?  i don't find a mention of it but can't
imagine it hasn't been implemented.

For example in the jsp

<html-el:select property="swimmingPool">
          <html-el:optionsCollection  property="swimmingPoolOptions"
value="name" label="name"/>
       </html-el:select>

Which generates the following ...
   <select name="swimmingPool"><option value="type.yes">type.yes</option>
<option value="type.no">type.no</option>
<option value="type.option_to_build">type.option_to_build</option>
<option value="type.undefined">type.undefined</option></select>

Is it possible to map type.no to a value in the resource bundles ??

--b

--
http://www.revoltingdigits.com
https://jestate.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0451-1, 12/14/2004 Tested on: 12/14/2004 10:40:25 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to