J'essaie d'internationaliser une application de test avec GWT following the instruction et j'ai:GWT Internationalisation lève une exception en reconsolidation
com.example.client.MyConstants.java
com.example.client.MyConstants_en.properties
com.example.client.MyConstants_fr.properties
com.example.client.MyAppEntryPoint.java
Dans ce code que j'ai:
public interface MyConstants extends Constants
{
@DefaultStringValue("HelloWorld")
String hellowWorld();
}
Et
public class MyAppEntryPoint implements EntryPoint
{
public void onModuleLoad()
{
MyConstants constants = GWT.create(MyConstants.class);
VerticalPanel mainPanel = new VerticalPanel();
mainPanel.add(new Label(constants.hellowWorld()));
RootPanel.get("myContainer").add(mainPanel);
}
}
Pour MyApp.gwt.xml J'ai:
<module rename-to="myModule">
<inherits name="com.google.gwt.xml.XML" />
<inherits name="com.google.gwt.i18n.I18N"/>
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- Specify the app entry point class. -->
<entry-point class='com.example.client.MyAppEntryPoint'/>
<extend-property name="locale" values="en,fr"/>
</module>
Dans le html j'ai:
...
Tout semble fonctionner aussi longtemps que je ne comprends pas dans le fichier xml. Dès que je fais, je reçois l'exception suivante:
[ERROR] Generator 'com.google.gwt.i18n.rebind.LocalizableGenerator' threw threw an exception while rebinding 'com.example.client.myConstants'
java.lang.NullPointerException: null
...
Toute aide serait grandement apprécié pourquoi il est jeter l'exception.
-
-
L'exemple de code GWT a " " –