You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maxim Solodovnik <so...@gmail.com> on 2014/10/17 10:11:41 UTC

Adding custom string resource bundle

Hello All,

I'm currently migration huge 1.4.x project to 6.17.0 and have question
about custom string bundle

CommonWebApplication.java
CommonWebApplication.xml
CommonWebApplication_de.xml

class CommonWebApplication extends AuthenticatedWebApplication {
    @Override
    protected void init() {
        super.init();
        //getResourceSettings().getStringResourceLoaders().add(new
BundleStringResourceLoader("CommonWebApplication.xml"));
        //getResourceSettings().getStringResourceLoaders().add(new
ClassStringResourceLoader(CommonWebApplication.class));
        getResourceSettings().getStringResourceLoaders().add(new
BundleStringResourceLoader(CommonWebApplication.class.getSimpleName()));
    }
}

MyApplication.java
MyApplication.xml
MyApplication_de.xml

class MyApplication extends CommonWebApplication {
    @Override
    protected void init() {
        super.init();
    }
}

Unfortunately I'm unable to load strings from "CommonWebApplication.xml"
What am I doing wrong?

-- 
WBR
Maxim aka solomax

Re: Adding custom string resource bundle

Posted by Maxim Solodovnik <so...@gmail.com>.
doesn't help :( will try to create quckstart

On 17 October 2014 15:16, Martin Grigorov <mg...@apache.org> wrote:

> Hi,
>
> Try with properties.xml as extension.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 17, 2014 at 11:11 AM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>
> > Hello All,
> >
> > I'm currently migration huge 1.4.x project to 6.17.0 and have question
> > about custom string bundle
> >
> > CommonWebApplication.java
> > CommonWebApplication.xml
> > CommonWebApplication_de.xml
> >
> > class CommonWebApplication extends AuthenticatedWebApplication {
> >     @Override
> >     protected void init() {
> >         super.init();
> >         //getResourceSettings().getStringResourceLoaders().add(new
> > BundleStringResourceLoader("CommonWebApplication.xml"));
> >         //getResourceSettings().getStringResourceLoaders().add(new
> > ClassStringResourceLoader(CommonWebApplication.class));
> >         getResourceSettings().getStringResourceLoaders().add(new
> > BundleStringResourceLoader(CommonWebApplication.class.getSimpleName()));
> >     }
> > }
> >
> > MyApplication.java
> > MyApplication.xml
> > MyApplication_de.xml
> >
> > class MyApplication extends CommonWebApplication {
> >     @Override
> >     protected void init() {
> >         super.init();
> >     }
> > }
> >
> > Unfortunately I'm unable to load strings from "CommonWebApplication.xml"
> > What am I doing wrong?
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: Adding custom string resource bundle

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Try with properties.xml as extension.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Oct 17, 2014 at 11:11 AM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Hello All,
>
> I'm currently migration huge 1.4.x project to 6.17.0 and have question
> about custom string bundle
>
> CommonWebApplication.java
> CommonWebApplication.xml
> CommonWebApplication_de.xml
>
> class CommonWebApplication extends AuthenticatedWebApplication {
>     @Override
>     protected void init() {
>         super.init();
>         //getResourceSettings().getStringResourceLoaders().add(new
> BundleStringResourceLoader("CommonWebApplication.xml"));
>         //getResourceSettings().getStringResourceLoaders().add(new
> ClassStringResourceLoader(CommonWebApplication.class));
>         getResourceSettings().getStringResourceLoaders().add(new
> BundleStringResourceLoader(CommonWebApplication.class.getSimpleName()));
>     }
> }
>
> MyApplication.java
> MyApplication.xml
> MyApplication_de.xml
>
> class MyApplication extends CommonWebApplication {
>     @Override
>     protected void init() {
>         super.init();
>     }
> }
>
> Unfortunately I'm unable to load strings from "CommonWebApplication.xml"
> What am I doing wrong?
>
> --
> WBR
> Maxim aka solomax
>

Re: Adding custom string resource bundle

Posted by Maxim Solodovnik <so...@gmail.com>.
It helps!
thanks a lot!

On 17 October 2014 15:49, Martin Grigorov <mg...@apache.org> wrote:

> On Fri, Oct 17, 2014 at 11:11 AM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>
> > Hello All,
> >
> > I'm currently migration huge 1.4.x project to 6.17.0 and have question
> > about custom string bundle
> >
> > CommonWebApplication.java
> > CommonWebApplication.xml
> > CommonWebApplication_de.xml
> >
> > class CommonWebApplication extends AuthenticatedWebApplication {
> >     @Override
> >     protected void init() {
> >         super.init();
> >
>
>
> >         //getResourceSettings().getStringResourceLoaders().add(new
> > BundleStringResourceLoader("CommonWebApplication.xml"));
> >         //getResourceSettings().getStringResourceLoaders().add(new
> > ClassStringResourceLoader(CommonWebApplication.class));
> >         getResourceSettings().getStringResourceLoaders().add(new
> > BundleStringResourceLoader(CommonWebApplication.class.getSimpleName()));
> >
>
> remove those. Wicket detects a bundle named as the Application class
> automatically
>
>
> >     }
> > }
> >
> > MyApplication.java
> > MyApplication.xml
> > MyApplication_de.xml
> >
> > class MyApplication extends CommonWebApplication {
> >     @Override
> >     protected void init() {
> >         super.init();
> >     }
> > }
> >
> > Unfortunately I'm unable to load strings from "CommonWebApplication.xml"
> > What am I doing wrong?
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: Adding custom string resource bundle

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Oct 17, 2014 at 11:11 AM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Hello All,
>
> I'm currently migration huge 1.4.x project to 6.17.0 and have question
> about custom string bundle
>
> CommonWebApplication.java
> CommonWebApplication.xml
> CommonWebApplication_de.xml
>
> class CommonWebApplication extends AuthenticatedWebApplication {
>     @Override
>     protected void init() {
>         super.init();
>


>         //getResourceSettings().getStringResourceLoaders().add(new
> BundleStringResourceLoader("CommonWebApplication.xml"));
>         //getResourceSettings().getStringResourceLoaders().add(new
> ClassStringResourceLoader(CommonWebApplication.class));
>         getResourceSettings().getStringResourceLoaders().add(new
> BundleStringResourceLoader(CommonWebApplication.class.getSimpleName()));
>

remove those. Wicket detects a bundle named as the Application class
automatically


>     }
> }
>
> MyApplication.java
> MyApplication.xml
> MyApplication_de.xml
>
> class MyApplication extends CommonWebApplication {
>     @Override
>     protected void init() {
>         super.init();
>     }
> }
>
> Unfortunately I'm unable to load strings from "CommonWebApplication.xml"
> What am I doing wrong?
>
> --
> WBR
> Maxim aka solomax
>