18.3. Indicating what generator to use and when

In your code we tell the GWT compiler that it needs to do something extra by using the GWT.create method to construct your objects. But you also need to tell the GWT compiler what that extra work is: in this case, what generator to use and when.

This is done by providing a generate-with tag definition in a module file. For internationalization, that’s done in the I18N module, which you inherit in your application’s module file. The definition is given in the I18N module in GWT 2.5 as follows:

<generate-with class="com.google.gwt.i18n.rebind.LocalizableGenerator">
  <when-type-assignable class="com.google.gwt.i18n.shared.Localizable" />
</generate-with>

(Pre GWT 2.5, the Localizable class was in ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.