You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stéphane Josephy <no...@pro.tiscali.be> on 2005/06/30 11:14:53 UTC
Problem rendering internationalized messages
Hi everyone,
Just crashed onto this site, seems all nice and useful, let's see if you can do
something for me (I'm a young Struts padawan :-) )
I'm working in a 3-legal-languages-country, so localization is a must.
I have messageResouces.properties declared in 3 locales, and some message like
this in all 3 .properties files:
main.request=You have requested an {0}
where arg0 is to be replaced by another localized message (let's say the user
can request an apple or an orange, and it has to be localized too); I don't want
to make a fusioned message like:
data.general.orange=You have requested an apple
data.general.apple=You have requested an orange
because there are just too much combinations.
I'm trying this, inside logic tags:
<bean:message key="main.request" locale="userLocale" arg0="<bean:message
key="main.request.orange" locale="userLocale"/>" />
but as you can guess, it doesn't work, so I'm trying to figure out a clean way
to pass a localized argument to the bean:message tag.
Can you point me to the right way?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Problem rendering internationalized messages
Posted by Stéphane Josephy <no...@pro.tiscali.be>.
Thanks Marco, it just works fine!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Problem rendering internationalized messages
Posted by Marco Mistroni <mm...@waersystems.com>.
Hello,
How about this?
<bean:define id="apple"><bean:message key="prompt.apple"/></bean:define>
<bean:message key="data.general" args0="<%=apple%>"/>
HTH
marco
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Stéphane Josephy
Sent: 30 June 2005 10:15
To: user@struts.apache.org
Subject: Problem rendering internationalized messages
Hi everyone,
Just crashed onto this site, seems all nice and useful, let's see if you
can do
something for me (I'm a young Struts padawan :-) )
I'm working in a 3-legal-languages-country, so localization is a must.
I have messageResouces.properties declared in 3 locales, and some
message like
this in all 3 .properties files:
main.request=You have requested an {0}
where arg0 is to be replaced by another localized message (let's say the
user
can request an apple or an orange, and it has to be localized too); I
don't want
to make a fusioned message like:
data.general.orange=You have requested an apple
data.general.apple=You have requested an orange
because there are just too much combinations.
I'm trying this, inside logic tags:
<bean:message key="main.request" locale="userLocale" arg0="<bean:message
key="main.request.orange" locale="userLocale"/>" />
but as you can guess, it doesn't work, so I'm trying to figure out a
clean way
to pass a localized argument to the bean:message tag.
Can you point me to the right way?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org