On my applications I add an IStringResourceLoader that looks for resources
at packages where beans are defined... So, all I do is register a key like
xxx.mypakage.MapType:MOBILE  and then this IStringResourceLoader will look
for a resource file namedBeans.properties at package xxx.mypakage and then
look for property MapType.MOBILE on that resource... That way this
localization is common to all pages, panels, etc, using the enum... or Bean.
I know Igor added a "package resources" some time ago, but don't know if
that can replace what I'm doing...

Hope this is what you where asking for?

Best,

Ernesto
On Wed, Sep 30, 2009 at 4:18 PM, Petr Fejfar <petr.fej...@gmail.com> wrote:

> Hi all,
>
> I have an enum type e.g.
>
> public enum MapType
>    UNDEFINED,ROADMAP,MOBILE,SATELITE,TERRAIN,HYBRID;
>
>    public static String toKeyword(MapType mapType) {
>        switch (mapType) {
>          case ROADMAP:
>              return "roadmap";
>              ...
>
>    public static MapType fromKeyword(final String keyword) {
>        final String kw = keyword.toLowerCase();
>        if (kw.equals("roadmap"))
>            return ROADMAP;
>        else if ...
>
>
>
> and I'd like to localize a verbal representation of particular elements
> which I could share throughout Wicket application in many places.
> i.e. I need something like this:
>
>    public static String verbose(MapType mapType) {
>        switch (mapType) {
>          case ROADMAP:
>              return getString("verbROADMAP");
>              ...
>
>
> What is a preferred/recommended way to localize it?
>
>
> Thanks, Petr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to