I was considering making an @Translate annotation for localization, more or
less the flip side of the existing @Generate, to facilitate getting
translation text from systems other than property files.

Basically, @Generate is useful to generate message catalogs as part of your
GWT compile---a post-facto list of all the messages that need to be
translated.  The up-front translations themselves are always searched as
property files, but it seems the relevant block of
AbstractLocalizableImplCreator.generateConstantOrMessageClass(), from line
95 to 140 of the current file, could be refactored into a default
translation generator, and a @Translate annotation added.  Anyone using that
annotation would get the logger and generator context, plus target class and
locale to generate for, and could find its translations wherever it wanted
to, perhaps by database lookup or automatic machine translation or whatever.
 In my case, I just want to make a fiddly "it's not a translation, but it's
unicode and/or long and/or RTL" approximation for debugging.

I considered instead trying to hook in at the level of the MethodCreator,
but by then we've already done our own resource lookup (a waste, in case of
overrides), although we could check and special-case that, of course.

Thoughts on the basic idea?
-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to