0

How to set up a custom zk-label.properties in a location other than /WEB-INF

asked 2012-05-18 07:23:03 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

I need to customize some zul labels on a deployment, but I cannot copy my zk-label.properties in the web application's WEB-INF directory. It must be hold within a library jar. According to the customization and packing code guide it's possible to independently configure any jar containing zk stuff by including a metainfo/zk/config.xml file. However, the means to specify label locations are the same as those in the main config.xml file: either absolute file locations or WEB-INF locations. I've peeped into the WebManager and Labels code and there is no way to set up an alternative label locator (a custom, classpath based one). Well, I've tried to register something like

Labels.register( new LabelLocator() {
            public URL locate( Locale locale ) throws Exception {
                return getClass().getClassLoader().getResource( "metainfo/zk/my-own-zk-label.properties" ); // For every locale, so that it's easier to see whether it works or not
            }
        } );

in my WebAppInit, with no success.

Any suggestion will be welcome.

César Varona

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2012-05-18 09:26:10 +0800

cvarona gravatar image cvarona
554 1 6

Forget about it, the Labels.register scheme does the trick (I had forgotten to specify the message code prefix, such as MZul.2050=...).

With kind regards

César

link publish delete flag offensive edit

answered 2012-05-20 07:25:44 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Cesar,

please give us more information how you solve this .

many thanks
Stephan

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-05-18 07:23:03 +0800

Seen: 204 times

Last updated: May 20 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More