Bonjour,
j'essaie d'intégrer l'internationalisation à une application GWT.

monPackageClient/utils/i18n/messages_fr.properties
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
food=nourriture
person=personne
...
(Idem pour messages_en.properties et messages_nl.properties)

monPackageClient/utils/i18n/Dictionary.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
public interface Dictionary extends Constants {
    String food();
    String person();
    ...
}
monPackageClient/utils/i18n/MyDictionary.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
public class MyDictionary {
    public static Dictionary words = (Dictionary) GWT.create(Dictionary.class);
}
monPackageClient/MonEntryPoint.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
String str = MyDictionary.words.meal()
Lors de l'exécution de l'application je capte l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[ERROR] No resource found for key 'person'
com.google.gwt.i18n.rebind.AbstractResource$MissingResourceException: No resource found for key 'person'
	at com.google.gwt.i18n.rebind.AbstractResource$ResourceList.getRequiredStringExt(AbstractResource.java:206)
	at com.google.gwt.i18n.rebind.SimpleValueMethodCreator.createMethodFor(SimpleValueMethodCreator.java:93)
	at com.google.gwt.i18n.rebind.AbstractLocalizableImplCreator.delegateToCreator(AbstractLocalizableImplCreator.java:307)
	at com.google.gwt.i18n.rebind.ConstantsImplCreator.emitMethodBody(ConstantsImplCreator.java:160)
	at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.genMethod(AbstractGeneratorClassCreator.java:263)
	at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.emitMethods(AbstractGeneratorClassCreator.java:231)
	at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.emitClass(AbstractGeneratorClassCreator.java:114)
	at com.google.gwt.i18n.rebind.AbstractLocalizableImplCreator.generateConstantOrMessageClass(AbstractLocalizableImplCreator.java:134)
	at com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:118)
	at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:49)
	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:113)
	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:62)
	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:172)
	at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:114)
	at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:474)
	at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:365)
	at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
	at com.google.gwt.core.client.GWT.create(GWT.java:91)
	at biz.manex.chbah.crc.web.client.CRC.onModuleLoad(CRC.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:326)
	at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:343)
	at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access$100(BrowserWidgetMoz.java:35)
	at com.google.gwt.dev.shell.moz.BrowserWidgetMoz$ExternalObjectImpl.gwtOnLoad(BrowserWidgetMoz.java:58)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1428)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
	at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:264)
	at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:557)
	at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
	at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:105)
Si quelqu'un a une idée... :-)