You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Zbynek Vavros <zb...@gmail.com> on 2019/01/27 22:09:50 UTC

Internationalization

Hi,

I'm trying to provide custom properties file for Wicket application.

I was going to use BundleStringResourceLoader using

getResourceSettings().getStringResourceLoaders().add(new
BundleStringResourceLoader("MyWicketApplication")).

Then I replaced "Required" message with my message it is not used.
After debugging into org.apache.wicket.Localizer I can see it iterates
through org.apache.wicket.resource.loader.IStringResourceLoader in this
order:

ComponentStringResourceLoader
PackageStringResourceLoader
ClassStringResourceLoader
ValidatorStringResourceLoader
InitializerStringResourceLoader
BundleStringResourceLoader

So the "Required" message is loaded from InitializerStringResourceLoader
before my BundleStringResourceLoader is hit.

How to properly provide Wicket with custom bundle containing ALL types of
messages?

Thanks,
Zbynek

Re: Internationalization

Posted by Zbynek Vavros <zb...@gmail.com>.
Aha the index!

Thanks

On Sun, Jan 27, 2019 at 11:21 PM Martin Grigorov <ma...@gmail.com>
wrote:

> Hi,
>
> if MyWicketApplication is the name of your application class then all you
> need to do is to create MyWicketApplication.properties next to it and it
> will be used with priority overthe defaults.
>
> If this is not the case then use .add(0, new Bundle....) and it will be
> consulted first.
>
>
> On Mon, Jan 28, 2019, 00:10 Zbynek Vavros <zbynekvavros@gmail.com wrote:
>
> > Hi,
> >
> > I'm trying to provide custom properties file for Wicket application.
> >
> > I was going to use BundleStringResourceLoader using
> >
> > getResourceSettings().getStringResourceLoaders().add(new
> > BundleStringResourceLoader("MyWicketApplication")).
> >
> > Then I replaced "Required" message with my message it is not used.
> > After debugging into org.apache.wicket.Localizer I can see it iterates
> > through org.apache.wicket.resource.loader.IStringResourceLoader in this
> > order:
> >
> > ComponentStringResourceLoader
> > PackageStringResourceLoader
> > ClassStringResourceLoader
> > ValidatorStringResourceLoader
> > InitializerStringResourceLoader
> > BundleStringResourceLoader
> >
> > So the "Required" message is loaded from InitializerStringResourceLoader
> > before my BundleStringResourceLoader is hit.
> >
> > How to properly provide Wicket with custom bundle containing ALL types of
> > messages?
> >
> > Thanks,
> > Zbynek
> >
>

Re: Internationalization

Posted by Martin Grigorov <ma...@gmail.com>.
Hi,

if MyWicketApplication is the name of your application class then all you
need to do is to create MyWicketApplication.properties next to it and it
will be used with priority overthe defaults.

If this is not the case then use .add(0, new Bundle....) and it will be
consulted first.


On Mon, Jan 28, 2019, 00:10 Zbynek Vavros <zbynekvavros@gmail.com wrote:

> Hi,
>
> I'm trying to provide custom properties file for Wicket application.
>
> I was going to use BundleStringResourceLoader using
>
> getResourceSettings().getStringResourceLoaders().add(new
> BundleStringResourceLoader("MyWicketApplication")).
>
> Then I replaced "Required" message with my message it is not used.
> After debugging into org.apache.wicket.Localizer I can see it iterates
> through org.apache.wicket.resource.loader.IStringResourceLoader in this
> order:
>
> ComponentStringResourceLoader
> PackageStringResourceLoader
> ClassStringResourceLoader
> ValidatorStringResourceLoader
> InitializerStringResourceLoader
> BundleStringResourceLoader
>
> So the "Required" message is loaded from InitializerStringResourceLoader
> before my BundleStringResourceLoader is hit.
>
> How to properly provide Wicket with custom bundle containing ALL types of
> messages?
>
> Thanks,
> Zbynek
>