Problème d'internationalisation d'une application Wicket
Bonjour à tous,
Voici mon premier post sur ce forum.
Je tente de procéder à l'internationalisation d'une application wicket. J'ai suivi plusieurs tutos puis adapter pour arriver au résultat souhaité, mais ça ne fonctionne pour le moment pas.
J'aimerai avoir dans un pannel 2 boutons me permettant de switcher d'une langue à l'autre...
Mon pannel se nomme 'WicketHeaderPannel'; j'ai donc un .java et un .html associé.
Dans mon .html j'ai ceci:
Code:
1 2 3
| <wicket:message key="helloworld">Hello</wicket:message>
<input type="submit" wicket:id="fr_language" value="FR"/> |
<input type="submit" wicket:id="en_language" value="EN"/> |
Dans mon .java, j'ai ceci (modification de Locale afin que wicket ne prenne pas le locale par défaut enregistré dans la session):
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| add(new Button("en_language")
{
@Override
public void onSubmit()
{
System.out.println("traceeeeeeeeee");
getSession().setLocale(Locale.ENGLISH);
setRedirect(true);
setResponsePage(HomePage.class);
}
});
add(new Button("fr_language")
{
@Override
public void onSubmit()
{
getSession().setLocale(Locale.FRENCH);
setRedirect(true);
setResponsePage(HomePage.class);
}
}); |
Lors d'un clic sur bouton, je me choppe une exception:
Citation:
GRAVE: Could not find Form parent for [MarkupContainer [Component id = en_language]]
org.apache.wicket.WicketRuntimeException: Could not find Form parent for [MarkupContainer [Component id = en_language]]
at org.apache.wicket.markup.html.form.FormComponent.getForm(FormComponent.java:737)
....
Une idée?
Edit:
J'ai bien sur un WicketHeaderPannel_en.properties(helloworld: Salut) et un WicketHeaderPannel_fr.properties(helloworld: Hellow) qui contienne ma clé "helloworld".