You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Mactaggart <st...@whitesquaresoft.com> on 2012/01/31 01:12:43 UTC

How to localise the ${type} in error messages

Hi all,

We have extensively localised our application using XML resource bundles,
but have just run into a few last corner cases.
We have error messages that come from the TextField's when the user enters
the wrong data type.

If we had a text field that is setup as an Integer type, and the user types
'abc' in it, they get the error message.

'abc' is not a valid Integer.

This is coming from our localisation of the following:
<entry key="IConverter">'${input}' is not a valid ${type}.</entry>

We can localise this into other languages like:

<entry key="IConverter">${input}' no es una válida ${type}.</entry>

But we still see:
'abc' no es una válida Integer.

Is there any way to localise the ${type} part of the strings?  We could
just re-write the error messages saying "they are not valid" but I like the
idea of being able to remind the user of exactly what is valid in the text
fields.

Cheers,
Steve

Re: How to localise the ${type} in error messages

Posted by Steve Mactaggart <st...@whitesquaresoft.com>.
Excellent, exactly what I needed.

Thanks.

On Tue, Jan 31, 2012 at 11:16 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> use a more specific key, such as IConverter.Integer=...
>
> -igor
>
> On Mon, Jan 30, 2012 at 4:12 PM, Steve Mactaggart
> <st...@whitesquaresoft.com> wrote:
> > Hi all,
> >
> > We have extensively localised our application using XML resource bundles,
> > but have just run into a few last corner cases.
> > We have error messages that come from the TextField's when the user
> enters
> > the wrong data type.
> >
> > If we had a text field that is setup as an Integer type, and the user
> types
> > 'abc' in it, they get the error message.
> >
> > 'abc' is not a valid Integer.
> >
> > This is coming from our localisation of the following:
> > <entry key="IConverter">'${input}' is not a valid ${type}.</entry>
> >
> > We can localise this into other languages like:
> >
> > <entry key="IConverter">${input}' no es una válida ${type}.</entry>
> >
> > But we still see:
> > 'abc' no es una válida Integer.
> >
> > Is there any way to localise the ${type} part of the strings?  We could
> > just re-write the error messages saying "they are not valid" but I like
> the
> > idea of being able to remind the user of exactly what is valid in the
> text
> > fields.
> >
> > Cheers,
> > Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to localise the ${type} in error messages

Posted by Igor Vaynberg <ig...@gmail.com>.
use a more specific key, such as IConverter.Integer=...

-igor

On Mon, Jan 30, 2012 at 4:12 PM, Steve Mactaggart
<st...@whitesquaresoft.com> wrote:
> Hi all,
>
> We have extensively localised our application using XML resource bundles,
> but have just run into a few last corner cases.
> We have error messages that come from the TextField's when the user enters
> the wrong data type.
>
> If we had a text field that is setup as an Integer type, and the user types
> 'abc' in it, they get the error message.
>
> 'abc' is not a valid Integer.
>
> This is coming from our localisation of the following:
> <entry key="IConverter">'${input}' is not a valid ${type}.</entry>
>
> We can localise this into other languages like:
>
> <entry key="IConverter">${input}' no es una válida ${type}.</entry>
>
> But we still see:
> 'abc' no es una válida Integer.
>
> Is there any way to localise the ${type} part of the strings?  We could
> just re-write the error messages saying "they are not valid" but I like the
> idea of being able to remind the user of exactly what is valid in the text
> fields.
>
> Cheers,
> Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org