Monday, December 23, 2013

Completely lost at internationalization (i18n)

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"/>

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"
>
<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:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<configuration>
<i18nMessagesBundle>com.mongoasis.presentation.i18n.Messages</i18nMessagesBundle>
<runTarget>mongoasis.html</runTarget>
<draftCompile>true</draftCompile>
<optimizationLevel>1</optimizationLevel>
<extraParam>true</extraParam>
</configuration>
</plugin>

According to some documentation I should be able to generate property files using mvn install or mvn gwt:i18n. However doing that results in errors/warnings the the com.mongoasis.presentation.i18n.Messages file could not be found. 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? 




--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment