I am not using the <s:text...> under any action. Remember, the change locale action returns a "redirect" result to a JSP page. So the browser sends a new request for a JSP page after the result is returned. One note: if I return a "dispatcher" result from that change locale action, then <s:text ..> renders the page in the new locale. But if I do a "redirect" to a JSP, the <s:text ..> tags within that JSP rendes the text in the default locale, even when I have made sure thru a filter that I have a different Locale on the ActionContext. Obviously, <s:text...> is not rendering other locales outside the context of an action "dispatcher" result; that is, for "redirects".
Why? How do I fix this problem? I need to use "redirect" to completely refresh the page. And I am redirecting to a JSP page. Should I redirect to another action ?? (it would seem to be a waste and confusing to add another action just to be able to render things in the change locale properly.) newton.dave wrote: > > 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] > > > -- View this message in context: http://www.nabble.com/-S2--s%3Atext-after-locale-change-displays-old-locale-values--tp15655762p15660584.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]