You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Jonas <ba...@gmail.com> on 2007/08/30 14:04:28 UTC
Localizer warning in 1.3.0-beta3
Hi,
after having upgraded 1.3.0-beta3, I noticed that the Localizer now
complains
in the log if getString is called with 'null' as component, even though the
javadoc
for this method states that the component is optional.
I'm not sure if the missing component has any further effects than
deactivating
the Localizer's cache (is that caching necessary anyway?) - could anyboy
shed
some light upon me?
A related question would be how to use the Localizer when I'm in a context
where I have no way of accessing the related component, e.g. for localized
Strings in a DynamicImageResource. Shouldn't I use the Localizer in that
case,
or what's the idea?
Thanks,
Jonas
Re: Localizer warning in 1.3.0-beta3
Posted by Jonas <ba...@gmail.com>.
Thanks for that quick fix, a follow-up question though:
Localizer uses IStringResourceLoader.loadStringResource(Component component,
String key).
While most of the IStringResourceLoader implementations correctly handle
a null component as parameter, BundleStringResourceLoader doesn't - it needs
a component to determine the locale. Wouldn't it make sense to use the
Session
locale as fallback if we don't have a component there?
cheers,
Jonas
On 8/30/07, Matej Knopp <ma...@gmail.com> wrote:
>
> Yeah, it's a bug and it's already fixed. Either update to current trunk or
> just set the logging treashold for Localizer class to ERROR.
>
> -Matej
>
> On 8/30/07, Jonas <ba...@gmail.com> wrote:
> >
> > Hi,
> >
> > It (1.3.0-beta3) does complain in if the component isn't added to the
> page
> > yet,
> > but it also complains if the component is null. If I understand this
> right
> > (and if the javadoc is correct), it shouldn't complain in the latter
> case.
> >
> > cheers,
> > Jonas
> >
> > I'm not sure if this was fixed in 1.3, but the localizer should only
> > > complain when the component is not yet added to it's parent (because
> the
> > > whole hierarchy can't be traversed to find the message).
> > >
> >
>
Re: Localizer warning in 1.3.0-beta3
Posted by Matej Knopp <ma...@gmail.com>.
Yeah, it's a bug and it's already fixed. Either update to current trunk or
just set the logging treashold for Localizer class to ERROR.
-Matej
On 8/30/07, Jonas <ba...@gmail.com> wrote:
>
> Hi,
>
> It (1.3.0-beta3) does complain in if the component isn't added to the page
> yet,
> but it also complains if the component is null. If I understand this right
> (and if the javadoc is correct), it shouldn't complain in the latter case.
>
> cheers,
> Jonas
>
> I'm not sure if this was fixed in 1.3, but the localizer should only
> > complain when the component is not yet added to it's parent (because the
> > whole hierarchy can't be traversed to find the message).
> >
>
Re: Localizer warning in 1.3.0-beta3
Posted by Jonas <ba...@gmail.com>.
Hi,
It (1.3.0-beta3) does complain in if the component isn't added to the page
yet,
but it also complains if the component is null. If I understand this right
(and if the javadoc is correct), it shouldn't complain in the latter case.
cheers,
Jonas
I'm not sure if this was fixed in 1.3, but the localizer should only
> complain when the component is not yet added to it's parent (because the
> whole hierarchy can't be traversed to find the message).
>
Re: Localizer warning in 1.3.0-beta3
Posted by Matej Knopp <ma...@gmail.com>.
Hi,
I'm not sure if this was fixed in 1.3, but the localizer should only
complain when the component is not yet added to it's parent (because the
whole hierarchy can't be traversed to find the message).
-Matej
On 8/30/07, Jonas <ba...@gmail.com> wrote:
>
> Hi,
>
> after having upgraded 1.3.0-beta3, I noticed that the Localizer now
> complains
> in the log if getString is called with 'null' as component, even though
> the
> javadoc
> for this method states that the component is optional.
> I'm not sure if the missing component has any further effects than
> deactivating
> the Localizer's cache (is that caching necessary anyway?) - could anyboy
> shed
> some light upon me?
> A related question would be how to use the Localizer when I'm in a context
> where I have no way of accessing the related component, e.g. for localized
> Strings in a DynamicImageResource. Shouldn't I use the Localizer in that
> case,
> or what's the idea?
>
> Thanks,
> Jonas
>