dev@glassfish.java.net

Re: duplicate message keys

From: Bobby Bissett <Robert.Bissett_at_Sun.COM>
Date: Sat, 16 Jan 2010 19:19:47 -0500

> Could you send the tool out again?
>
> I've gone through all your e-mails in this mailing list in my mail
> box but couldn't find it. Must have lost it.

Sure, here you go. Hopefully what you need to do should be simple to
follow, even for non Python people. Instructions are at the top of the
file -- you just set a couple directories and run 'python
keychecker.py' from the command line.

Begin forwarded message:

> From: Bobby Bissett <Robert.Bissett_at_Sun.COM>
> Date: October 19, 2009 3:25:25 PM EDT
> To: dev_at_glassfish.dev.java.net
> Subject: checking for unused i18n keys in resource files
> Reply-To: dev_at_glassfish.dev.java.net
>
> Speaking of logging (from another thread)....
>
> I was going to ask if there was a tool to check props files against
> source code to look for unused i18n keys, but it was almost as easy
> just to write one myself. If anyone is interested in trying it, I've
> attached it. It should be self-explanatory what you need to do; just
> check the top of the file for things to set (directory names, file
> extensions, etc). I found >20 unused keys in the upgrade tool, which
> isn't surprising since it's been simplified so much.
>
> If you're not on Windows, you probably have Python somewhere and can
> edit/run the file right away. Otherwise, you can download Python,
> download Jython, grab the Python module for NetBeans that comes with
> Jython, log into a unix box, or just ask your neighbor to run it.
>
> The only non-obvious logic in the script is that it only checks
> source code that is in the same package as the resource file since
> that's the way things seem to work around here. If you're using one
> big resource bundle for all your packages, you'll need to tweak
> things or let me know and maybe I'll get to it. This isn't meant to
> be a pro solution, but just something helpful.
>
> Disclaimer: don't go removing things from your source code based
> solely on my hack....
>
> Cheers,
> Bobby
>


>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net