You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arie Fishler <ar...@gmail.com> on 2009/08/17 10:04:28 UTC

Controlling the order of resource files

Hello,

The normal way wicket goes over resource files is based on locale and
different component names, application name etc.

What's the best practice for a situation in which I would like my
application to find the resource file based on a "skin".
This means that for the same classes set (same wicket application) and same
local I still need to have different texts for a certain resource key.

It is like I need another selection mechanism for resource file which is not
the locale but something that is specific to the logic of my application.

Is there some way to implement that? Like making wicket look for resource
files the same way it does but add a prefix for every resource file name....

Thanks,
Arie

Re: Controlling the order of resource files

Posted by bgooren <ba...@iswd.nl>.
Arie,

This is possible out-of-the-box using Session.setStyle();

Setting a style will make wicket consider resource files and property files
with the style you've specified.

The following is from the Component javadoc:

Style - The style ("skin") for a component is available through getStyle(),
which is equivalent to getSession().getStyle(). Styles are intended to give
a particular look to a Component or Resource that is independent of its
Locale. For example, a style might be a set of resources, including images
and markup files, which gives the design look of "ocean" to the user. If the
Session's style is set to "ocean" and these resources are given names
suffixed with "_ocean", Wicket's resource management logic will prefer these
resources to other resources, such as default resources, which are not as
good of a match. 

Bas


Arie Fishler-2 wrote:
> 
> Hello,
> 
> The normal way wicket goes over resource files is based on locale and
> different component names, application name etc.
> 
> What's the best practice for a situation in which I would like my
> application to find the resource file based on a "skin".
> This means that for the same classes set (same wicket application) and
> same
> local I still need to have different texts for a certain resource key.
> 
> It is like I need another selection mechanism for resource file which is
> not
> the locale but something that is specific to the logic of my application.
> 
> Is there some way to implement that? Like making wicket look for resource
> files the same way it does but add a prefix for every resource file
> name....
> 
> Thanks,
> Arie
> 
> 

-- 
View this message in context: http://www.nabble.com/Controlling-the-order-of-resource-files-tp25002679p25002802.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Controlling the order of resource files

Posted by Arie Fishler <ar...@gmail.com>.
Many thanks guys...this is exactly what I meant. Happy this is found in the
base of wicket. Anoter example of how flexible and great wicket is:)

Cheers..great day to all.

Arie.

On Mon, Aug 17, 2009 at 11:17 AM, Wilhelmsen Tor Iver <To...@arrive.no>wrote:

> > It is like I need another selection mechanism for resource file which
> > is not
> > the locale but something that is specific to the logic of my
> > application.
>
> Look at "styles", i.e. Session.setStyle(String) and the documentation there
> for resource lookup. Basically the style "tag" goes before the locale, e.g.
> MyPage_foo_nl.properties for locale nl and style "foo".
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

SV: Controlling the order of resource files

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> It is like I need another selection mechanism for resource file which
> is not
> the locale but something that is specific to the logic of my
> application.

Look at "styles", i.e. Session.setStyle(String) and the documentation there for resource lookup. Basically the style "tag" goes before the locale, e.g. MyPage_foo_nl.properties for locale nl and style "foo".


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