This content has been marked as final.
Show 3 replies
-
1. Re: Wicket-Seam Internationalization best Practice
uwejanner.uwejanner.janner.at Aug 24, 2009 1:29 AM (in response to mephisto)hi nico,
as seam and wicket use completely different ways to handle i18n you have to couple them manually; you have to decide who is the
master
.e.g. you want wicket to let seam do the i18n work:
getResourceSettings().addStringResourceLoader(new MyStringResourceLoader()); public class MyStringResourceLoader implements IStringResourceLoader { @Override public String loadStringResource(Component _component, String _key) { return getSeamResourceBundle().getString(_key); } @Override public String loadStringResource(Class _clazz, String _key, Locale _locale, String _style) { return getSeamResourceBundle().getString(_key); } private ResourceBundle getSeamResourceBundle() { return ResourceBundle.getBundle(SeamResourceBundle.class.getName(), Session.get().getLocale()); } }
e.g., you want seam using the locale that wicket chose:
overwrite seam's locale component with your implementation:@Scope(ScopeType.STATELESS) @Name("org.jboss.seam.core.locale") @Install(precedence=APPLICATION) @BypassInterceptors public class MyLocale extends org.jboss.seam.core.Locale{ @Unwrap @Override public java.util.Locale getLocale(){ Locale locale = Locale.US; Session session = Session.get(); if( session!=null ){ if( session.getLocale()!=null ){ locale = session.getLocale(); } } return locale; } }
hope this helps,
cheers uwe!
-
2. Re: Wicket-Seam Internationalization best Practice
prati Nov 27, 2009 1:57 PM (in response to mephisto)Hi
I just followed above steps created both classes,Now my wicket web page can read messagesen.properties,But when i change locale to France etc.It can't locate that.
enGB is my default locale.
Everytime it shows me in English.Thanks
-
3. Re: Wicket-Seam Internationalization best Practice
prati Nov 27, 2009 2:02 PM (in response to mephisto)I am kind of struggling with thing ,Dont know where i am doing wrong ,I can set Locale to any other language using Session ,but its not able to read that corrosponding message.properties .I am using Wicket+Seam.
Thanks in Advance!!