You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Paransky <al...@individualnetwork.com> on 2002/03/26 20:08:16 UTC

RE: I18N question

Well, the value you store in the actual field would have to be
"priority.low", "priority.normal", or "priority.hi" instead of "normal,
high, or low.  Then you can simply use the bean:message instead of
bean:write.  The bean:message tag will treat the property= as the "key" in
to the resource bundle.  Alternatively you can prepend "priority." to the
value of your data and then pass that to the message tag, as in:

<bean:define id="priority" name="bean" property="priority"/>
<bean:message name="<%="priority." + priority"/>

For example...

-------------
-AP_
See my profile at
http://www.myprofiles.com/member/view.do?profileId=128


-----Original Message-----
From: liquid@kabsi.at [mailto:liquid@kabsi.at]
Sent: Saturday, January 26, 2002 5:21 AM
To: struts-user@jakarta.apache.org
Subject: I18N question


Hi!

In my application I have an enumeration called priority containg values
"low", "normal" and "high". At one point of the application the user can
enter the priority using a selection list. Localizing here works fine like
this:

<html:select property="priority"><html:option value="low"
key="priority.low"/><html:option value="normal"
key="priority.normal"/><html:option value="high"
key="priority.high"/></html:select></td>

using a property file looking like this:

priority.low=Niedrig
priority.normal=Mittel
priority.high=Hoch

Like I said, this works perfectly well. But at another point of the
application
the choosen priority should be displayed.
A simple
<bean:write name="bean" property="priority"/>
would display the not localized values "low", "normal" or "high", but
ofcourse
I would like to have the localized strings "Niedrig", "Mittel", or "Hoch" to
be shown...

Any clues ?

thanks,

Gernot.



---------------------------------------------
Kabelsignal AG                        Webmail
http://www.kabelsignal.at



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>