Greetings,

I've been working on a large GWT project with many Constants and Messages 
interfaces scattered throughout the code (I prefer to keep them along with 
the classes which use them rather than having one single application wide 
file, it helps modularity etc). There are something in the order of 400 
constants and messages, more like 450 when we count different plural forms, 
so translation is outsourced from my client to various external entities. 
We can't sensibly give them the source tree, not only is it confidential 
but they wouldn't know what to do with it anyway.

So, what I've done is I've created a doclet. This doclet will scan the 
source tree for sub-interfaces of Messages or Constants, read javadoc plus 
any annotations (@Meaning, @Description etc) along with plural forms for 
messages, default values etc. It will then look to see if there's already a 
properties file for the specified locale, using values defined there if so. 
It writes a properties file for each interface into a 'translations/LOCALE' 
directory parallel to the first element in the source path, building all 
available information into the properties files as comments. If you've 
annotated the code properly with docs and annotations these properties 
files then contain all the information required by a translation bureau, 
and can be shipped off for translation. When you have the translations back 
you can run the doclet again in import mode which will parse the translated 
properties and write out any values which have been translated out into the 
appropriate places in the source tree.

Code is a single doclet (so compile with tools.jar on the classpath) and 
currently under MIT license (if that's a problem I can easily re-license 
it), github repo is at https://github.com/tomoinn/gwt-translation-helper, 
help yourself - hopefully it'll be of use to others attempting to make full 
use of the i18n support in GWT!

Cheers,

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/uGpcluPj0OoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to