Re: Custom implementation of IStringResourceLoader not working

2011-01-31 Thread armandoxxx

will try .. 10x ! 

Regards

Armando
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-implementation-of-IStringResourceLoader-not-working-tp3244747p3248311.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Custom implementation of IStringResourceLoader not working

2011-01-28 Thread Pedro Santos
Since loadStringResource(Component, String) implementation is returning the
message key, the Localizer thinks the message for the key was found.
Delegate its call to the loadStringResource(Class, String, Locale, String)
method that uses the dictionary.

On Fri, Jan 28, 2011 at 1:42 PM, armandoxxx wrote:

>
> Hi guys ...
>
> I need some help with custom IStringResourceLoader
>
>
>
> public class DictionaryResourceLoader implements IStringResourceLoader {
>
>private static final Logger
>LOG
> =
> LoggerFactory.getLogger(DictionaryResourceLoader.class);
>
>private ControllerFactory
>controllerFactory
> = null;
>
>
>/**
> * Constructor.
> * @param theControllerFactory  reference to application
> */
>public DictionaryResourceLoader(final ControllerFactory
> theControllerFactory) {
>this.controllerFactory  = theControllerFactory;
>}
>
>
>
>/* (non-Javadoc)
> * @see
>
> org.apache.wicket.resource.loader.IStringResourceLoader#loadStringResource(org.apache.wicket.Component,
> java.lang.String)
> */
>@Override
>public String loadStringResource(final Component theComponent, final
> String
> theKey) {
>return theKey;
>}
>
>
>/* (non-Javadoc)
> * @see
>
> org.apache.wicket.resource.loader.IStringResourceLoader#loadStringResource(java.lang.Class,
> java.lang.String, java.util.Locale, java.lang.String)
> */
>@Override
>public String loadStringResource(final Class theClazz, final
> String
> theKey, final Locale theLocale, final String theStyle) {
>DictionaryController dict   =
>
> (DictionaryController)this.controllerFactory.getController(DictionaryController.class);
>
>return dict.getTerm(theKey, theLocale.getLanguage());
> //calls backend to
> get translated string for the key
>
>}
>
>
> }
>
>
>
>
> in application init I have
>
> getResourceSettings().addStringResourceLoader(0, new
> DictionaryResourceLoader(this.controllerFactory));
>
>
>
> and in markup:
>
> 
>
>
>
>
> and when I debug .. my DictionaryResourceLoader is not beeing called ..
> neither method ...
>
> what am I doing wrong ?
>
> Regards
>
> Armando
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Custom-implementation-of-IStringResourceLoader-not-working-tp3244747p3244747.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos