Cannot find generated I18 UiBinder Files

133 views
Skip to first unread message

Chris Lowe

unread,
Dec 10, 2009, 9:39:08 AM12/10/09
to Google Web Toolkit
I've been trying to test the I18 features of UiBinder but I cannot
locate the generated properties file.

My procedure is this:

* Generate a new GWT 2.0 project called I18Test, with a package called
com.example

* Using the plugin, add a UiBinder asset called MainView to
com.example.client. I amended the generated code as follows:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"


ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'

ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"
ui:generateLocales="default">
<ui:style>
.important {
font-weight: bold;
}
</ui:style>
<g:HTMLPanel>
<ui:msg description="Hello message">Hello</ui:msg>,
<g:Button styleName="{style.important}" ui:field="button" />
</g:HTMLPanel>
</ui:UiBinder>


* As a quick hack just to get the panel to show, I just amended the
generated module entry point to add the following:

RootPanel.get("sendButtonContainer").add(new MainView("Click me"));

* When I run the app, everything appears okay. When I compile, I get
a message reporting that a file called
com.example.client.MainViewMainViewUiBinderImplGenMessages.properties
has been generated:

Compiling module com.example.I18Test
Scanning for additional dependencies:
generated://4B78699A3BEB50FB1BC134587BCF4F2F/com/example/client/MainView_MainViewUiBinderImpl.java
Computing all possible rebind results for
'com.example.client.MainViewMainViewUiBinderImplGenMessages'
Rebinding
com.example.client.MainViewMainViewUiBinderImplGenMessages
Invoking
com.google.gwt.dev.javac.StandardGeneratorContext@39f3bb
Generating
com.example.client.MainViewMainViewUiBinderImplGenMessages.properties
from MainViewMainViewUiBinderImplGenMessages_ for locale default
Compiling 6 permutations
Compiling permutation 0...
Compiling permutation 1...
Compiling permutation 2...
Compiling permutation 3...
Compiling permutation 4...
Compiling permutation 5...
Compile of permutations succeeded
Linking into C:\Users\lowec\workspace\I18Test\war\i18test.
Link succeeded
Compilation succeeded -- 29.125s


However, I cannot find this file anywhere! Are there any more steps
that I need perform to get at the file?

Cheers,

Chris.

Chris Lowe

unread,
Dec 12, 2009, 10:42:02 AM12/12/09
to Google Web Toolkit
I'm still not having any luck with this. I've seen the comments by
rjrjr on the UiBinderI18n wiki:

http://code.google.com/p/google-web-toolkit/wiki/UiBinderI18n

"@benzheren, yes, and sorry it doesn't yet do the extra bit by
default. I think the best thing to do is add these attributes to your
root <ui:UiBinder> element:

ui:generateLocales="default"

ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"

ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
This will generate a .properties file for each template (look for it
in the package's -aux directory, e.g. com.me.my.app-aux/
com.me.my.app.MyWidgetImplGenMessages?.properties). These particular
settings will make the name of each message string an MD5 hash of its
contents, so that your translations won't get mis-mapped as things
move within the template."

At risk of sounding like a lemon, I cannot find the aux folder
anywhere - is this something that should be generated automatically?
From my first post, the compile output suggests that I should have a
file called
"com.example.client.MainViewMainViewUiBinderImplGenMessages.properties" (or
at least a file called
"MainViewMainViewUiBinderImplGenMessages.properties") sitting
somewhere but even a search of all files using the following from
cygwin does not reveal anything:

$ find /cygdrive/c -iname "*MainView*.properties" 2> /dev/null

(Yields nothing)

Can anyone offer me any tips for tracking this down?

Cheers,

Chris.

Chris Lowe

unread,
Dec 14, 2009, 5:13:26 PM12/14/09
to Google Web Toolkit
Right - I only found a .properties file in my project's extras folder
if the "-soyc" compiler option had been added or if I explicitly
specified the extra directory location using "-extra". Without either
of these explicit compile time parameters I get *no* properties file.

Also beware of the generateFilename attribute. Yes a different
properties file is _generated_, but the associated Message interface
does not use it so you still have to rename the properties file back
to the default naming convention and place a copy located in the same
location as the .ui.xml in order for it to be picked up at _runtime_.

I finally have some UiBinder code using i18n but it needed a
frustrating mix of guesswork and picking through generated assets to
get there - hopefully the documentation will be amended soon.

Cheers,

Chris.

Chris Lowe

unread,
Dec 15, 2009, 4:54:05 AM12/15/09
to Google Web Toolkit
There is now a case relating to this:

http://code.google.com/p/google-web-toolkit/issues/detail?id=4355

Add you're vote if this is important to you.

Cheers,

C.

Chris Lowe

unread,
Dec 15, 2009, 4:54:58 AM12/15/09
to Google Web Toolkit
Damn typo - you're = your
Reply all
Reply to author
Forward
0 new messages