You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jean-Yves Sironneau <jy...@fr.st> on 2005/09/01 23:25:02 UTC

simple localization question

Hello,

I have a simple question, when an error occurs in one of my pages i set 
an attribute to  a string  that  should be localized, but in my template 
i don't konw how to insert it, i tried

    <span jwcid="@Insert" value="message:page.error"/>

but the page.error is resolved as a literal, noot an ognl expression.


Thank you

Jean-Yves

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: simple localization question

Posted by Chris Chiappone <ch...@gmail.com>.
you could also just use <span key="page.error"/> if its a static error
from your properties file.

On 9/1/05, Ted Steen <te...@gmail.com> wrote:
> If you write "message:page.error" tapestry will look for a message
> called "page.error", that is it will look in your .properties file for
> that message.
> If you want to dynamically choose the message I think the best thing
> would be to do like this:
> 
> <span jwcid="@Insert" value="ognl:pageError" />
> 
> public String getPageError() {
>   return getMessages().getMessage(getMyErrorMessage());
> }
> 
> This might be a case of blind leading the blind, and I also don't
> understand why you would like to do this thing :)
> 
> On 9/1/05, Jean-Yves Sironneau <jy...@fr.st> wrote:
> > Hello,
> >
> > I have a simple question, when an error occurs in one of my pages i set
> > an attribute to  a string  that  should be localized, but in my template
> > i don't konw how to insert it, i tried
> >
> >     <span jwcid="@Insert" value="message:page.error"/>
> >
> > but the page.error is resolved as a literal, noot an ognl expression.
> >
> >
> > Thank you
> >
> > Jean-Yves
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> --
> /ted
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: simple localization question

Posted by Ted Steen <te...@gmail.com>.
If you write "message:page.error" tapestry will look for a message
called "page.error", that is it will look in your .properties file for
that message.
If you want to dynamically choose the message I think the best thing
would be to do like this:

<span jwcid="@Insert" value="ognl:pageError" />

public String getPageError() {
  return getMessages().getMessage(getMyErrorMessage());
}

This might be a case of blind leading the blind, and I also don't
understand why you would like to do this thing :)

On 9/1/05, Jean-Yves Sironneau <jy...@fr.st> wrote:
> Hello,
> 
> I have a simple question, when an error occurs in one of my pages i set
> an attribute to  a string  that  should be localized, but in my template
> i don't konw how to insert it, i tried
> 
>     <span jwcid="@Insert" value="message:page.error"/>
> 
> but the page.error is resolved as a literal, noot an ognl expression.
> 
> 
> Thank you
> 
> Jean-Yves
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
/ted

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org