On Monday, December 23, 2013 11:24:20 PM UTC+1, Qunit wrote:
I'm completely stumped on I18n. Any help would be greatly appreciated. Here's my info:
- Using mvn 3.0.5
- Using uiBinder
- GWT 2.5.1 with GWTBootstrap
- Eclipse 4.2 with maven integration
All working, except when trying to add I18n for dutch (nl, default) and english (en)
Part of .gwt.xml
<inherits name="com.google.gwt.i18n.I18N" />
<extend-property name="locale" values="nl" />
<extend-property name="locale" values="en" />
<set-property-fallback name="locale" value="en"/>
<set-property name="locale" value="nl"/>
That last line is saying that only "nl" locale will actually be compiled. You probably want value="nl,en", though I've been told that removing the 'default' locale might break a few things (haven't personally noticed anything though).
Example part of uiBinder:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" 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"
You disabled the 'default' locale, so maybe you'll want ui:generateLocales="en, nl"
…or maybe you meant ui:defaultLocale="en" ? (equivalent to @DefaultLocale)
> <b:Container> <b:Container ui:field="signupContainer"> <b:Row> <b:Paragraph><ui:msg description="Enter user details">Please enter your details to signup</ui:msg></b:Paragraph> </b:Row>
Part of pom.xml:
According to some documentation I should be able to generate property files using mvn install or mvn gwt:i18n.
"mvn gwt:i18n" is about generating com.google.gwt.i18n.client.Messages interfaces from existing .properties files (from your src/main/resources folder), so it's not what you want here.
However doing that results in errors/warnings the the com.mongoasis.presentation.i18n.Messages file could not be found.
This is probably because gwt:i18n cannot find a com/mongoasis/presentation/i18n/Messages.properties file in src/main/resources (that's the name you gave in i18nMessagesBundle, which is a configuration property for the gwt:i18n goal).
Because of that error, your build fails and the GWT compiler (that would generate properties files from your UiBinder templates) is not run (gwt:i18n runs a generate-sources while gwt:compile runs at prepare-package, which is much later in the Maven lifecycle)
So I create it manually after which it complains that it is ampty. Adding random key-value pairs stops the error message, but nowhere I find MD5 hashed properties to fill in. Event specifying the key manually does not result in the text being replaced with any translated text.
I'm felling lost and alone in a dark world... Who enlightens me?
First, don't use gwt:i18n unless you know you need it. It's only useful for a few specific cases, and even more-specific cases if you consider binding it to the build lifecycle.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/google-web-toolkit
For more options, visit https://groups.google.com/groups/opt_out