Hi Craig,

yes you're right, this would work but I wanted to get an understanding of the algorithm and tried the examples mentioned in the wiki page. In addition I dont don't like find-grained property-files and at the moment I'm using one big Application.properties file with the full class-name of a component as a prefix (so the keys are changed too during
refactoring)



On 04.08.2009, at 18:42, Craig McIlwee wrote:

Have you tried creating a properties file for the panel, Sidebar.properties? By putting the value in your Index.properties aren't you kind of breaking encapsulation by adding knowledge of the panel's inner workings to the page?

-----Original Message-----
From: Robin Sander [mailto:robin.san...@gmx.net]
Sent: Tuesday, August 04, 2009 10:54 AM
To: users@wicket.apache.org
Subject: Re: Label i18n in 1.4 final


Hi,

yes, this does work but would interfere with a page-level label called
"header", doesn't it?
That's why the component-path up to the page is used as a prefix, I
thought...


On 04.08.2009, at 16:21, Eyal Golan wrote:

As far as I remember, you need to call the proprty 'header'

header = Sidebar Header!



Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really
necessary


On Tue, Aug 4, 2009 at 5:14 PM, Robin Sander <robin.san...@gmx.net>
wrote:


Hello,

I'm trying to add internationalization to my wicket application using
Wicket 1.4 final.
In order to customize labels I don't use wicket:message but use Label
subclasses.

So, both the Wiki page "General i18n in Wicket" an Wicket in Action
state
that I may define
a property file for a page, say Index.properties and define any label
resource in this file.

So far so good, it seems to work as long as I don't have a label
nested in
a panel or in a form!
Say I have a page Index and a panel Sidebar like this:

public class Sidebar extends Panel {
     public Sidebar(final String id) {
             super(id);
             add(new Label("header", new ResourceModel("header")));
             ...
    }
}

public class Index extends WebPage {
     public Index() {
             super();
             add(new Sidebar("sidebar"));
    }
}

Now, if I define

sidebar.header = Sidebar Header!

in a file 'Index.properties' a MissingResourceException is thrown.
Does anybody know how to do it right?

regards,

Robin.


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




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




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


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

Reply via email to