I've never been entirely clear on all the places that affect I18N, but does
the action under which you're using the <s:text.../> tag extend ActionSupport
(which implements TextProvider)?

Dave

--- Rubens <[EMAIL PROTECTED]> wrote:
> struts.xml has this:
> 
>     <constant
>         name="struts.custom.i18n.resources"
>         value="resources" />
> 
> I have resources.properties and resources_pt.properties deployed in the
> WEB-INF classpath area.  In fact, the text rendered by <s:text../> is from
> resources.properties even when the Locale is "pt".
> 
> 
> Laurie Harper wrote:
> > 
> > Rubens wrote:
> >> I am changing locale from an Action, then returning a "redirect" result
> >> to
> >> refresh the page.  However, the new locale is not being fetched into the
> >> <s:text../> tags.  <s:text.../> insists in fetching messages from the
> old
> >> locale.  I already checked to make sure I have the resource bundles
> files
> >> in
> >> the classpath.  And all the configuration appears correct.
> >> 
> >> Here is the code that changes the locale:
> >> 
> >> .... // this.locale contains the new locale 
> >> session.put(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE, this.locale);
> >> ActionContext.getContext().setLocale(this.locale);
> >> 
> >> I even wrote a LocaleFilter to enforce the new locale on the
> >> ActionContext
> >> after a re-direct:
> >> 
> >>         // tries to resolve locale from session attributes
> >>         Locale locale = LocaleUtils.resolveLocale((HttpServletRequest)
> >> request);
> >>         // I see the new locale set here
> >>         if (logger.isDebugEnabled())
> >>         {
> >>             logger.debug("configuring locale [" + locale +
> >>                 "] on Spring LocaleContextHolder and Struts
> >> ActionContext");
> >>         }
> >> 
> >>         // set locale on the Struts ThreadLocal Context
> >>         ActionContext.getContext().setLocale(locale);
> >> 
> >>         chain.doFilter(request, response);
> >>        ....
> >> 
> >> Why is <s:text name="text.login.newUser" /> still fetching values from
> >> the default locale?
> > 
> > Are the resource bundle files names correctly? Are they in the right 
> > place? Are they being deployed correctly?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to