struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grish <gin1...@hotmail.com>
Subject Re: Using il8n text in an interceptor
Date Tue, 12 Feb 2008 09:22:02 GMT

Thanks for the suggestion! I tried integrating it to my code but the problem
is findDefaultText always returns null. I traced the name and the locale
that I am passing and they are correct. 

my package_en_US.properties is in my org.test.app.action package. My
interceptor is in the org.test.app.interceptor package. Would the location
of the property file be the problem? 

I read the API and I had the impression that if I moved up the properties up
one level the properties file will still be seen. 

I tried moving it to org.test.app package  but i still seem to be getting
null. Is there something wrong with my setup perhaps?


Pablo Vazquez wrote:
> 
> // For future i18n purpose
>      private String translate(String name) {
>         
>          String i18Name = LocalizedTextUtil.findDefaultText(name, locale);
>         
>          if (i18Name == null) {
>              i18Name = name;
>          }
>         
>          return i18Name;
>      }
> 
> Grish escribió:
>> I'm studying how interceptors work and made a login interceptor based on
>> Mark
>> Menard's great tutorial:
>> http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor
>>
>> I managed to integrate the interceptor in my sample application but I
>> want
>> to access my resource bundle for the localized error message. Is there a
>> method similar to the getText method for Interceptors? What would be  the
>> best approach for adding localized action error messages from an
>> interceptor?
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-il8n-text-in-an-interceptor-tp15427096p15429285.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message