the reverse: creating properties file out of existing Constants/Messages interfaces

83 views
Skip to first unread message

vlad.balan

unread,
Apr 14, 2011, 7:06:47 AM4/14/11
to Google Web Toolkit
Hello,

with GWT's i18nCreator and i18nSync classes you can create a
corresponding Constants subinterface for your existsing properties
file.
How can you achive the reverse?
A revers operation would use your Constans interface (containing
information like @Generate(String[] formatFQCN, String filename,
String[] locales)) to create GWT-style properties files for your
listed constants declarations.

But i18nSync does not do it. Is there another tool?

vlad.balan

unread,
Apr 14, 2011, 4:41:46 AM4/14/11
to Google Web Toolkit

Soon Fatt Hoo

unread,
Apr 14, 2011, 2:38:04 PM4/14/11
to Google Web Toolkit
On your constants interface add this @Generate(format =
"com.google.gwt.i18n.rebind.format.PropertiesFormat")

then compile your gwt code with -extra extras


@Generate(format =
"com.google.gwt.i18n.rebind.format.PropertiesFormat")
public interface ExampleConstants extends ConstantsWithLookup {
@DefaultStringValue("New")
String newButton();
}

That should generate a properties file with

newButton = New

mma

unread,
Feb 23, 2012, 7:57:03 AM2/23/12
to google-we...@googlegroups.com
Vlad - Thanks for posing the question.

Soon - Thanks for providing the answer.

This is a lot better than creating the properties files first and then generating the interfaces.
Reply all
Reply to author
Forward
0 new messages