GWT uses standard java message bundles for internationalization (i18n), but use the compile-time multiple-permutation strategy to create a JavaScript output file per supported language. On client-side code, developers use Message interface to read String from the bundle. Such interfaces can be generated by a SDK tool.
If you're not familiar with this please review i18n interfaces generator documentation.
The plugin can be used to generate such Message interface. Just add the required goal and configuration to plugin execution :
<project> [...] <build> <plugins> [...] <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.8.1</version> <executions> <execution> <goals> <goal>i18n</goal> </goals> </execution> </executions> <configuration> <resourceBundle>com.mycompany.gwt.Bundle</resourceBundle> </configuration> </plugin> [...] </plugins> </build> [...] </project>
The resourceBundle parameter is used to declare your application bundle for i18n processing. If your application uses more than one bundle, you can nest multiple resourceBundle elements :
<project> [...] <build> <plugins> [...] <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.8.1</version> <executions> <execution> <goals> <goal>i18n</goal> </goals> </execution> </executions> <configuration> <resourceBundles> <resourceBundle>com.mycompany.gwt.Bundle1</resourceBundle> <resourceBundle>com.mycompany.gwt.Bundle2</resourceBundle> <resourceBundle>...</resourceBundle> </resourceBundles> </configuration> </plugin> [...] </plugins> </build> [...] </project>
By default, the i18nCreator is configured to generate interface based on the Messages interface.
If you prefer to use the Constants class as base class, set the messages parameter to false.
You can also configure the plugin using the constantsWithLookup parameter to use ConstantsWithLookup interface.
For more information on distinctions between those interfaces, please review the GWT i18n documentation.