weaver 2004/08/24 07:09:31
Modified:
applications/localeselector/src/java/org/apache/jetspeed/portlets/localeselector
LocaleSelectorPortlet.java
Log:
LocaleSelector portlet now changes the locale for the entire portal not just the
portlet app it is loaded from
Revision Changes Path
1.2 +7 -2
jakarta-jetspeed-2/applications/localeselector/src/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java
Index: LocaleSelectorPortlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/applications/localeselector/src/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LocaleSelectorPortlet.java 5 Aug 2004 04:49:04 -0000 1.1
+++ LocaleSelectorPortlet.java 24 Aug 2004 14:09:30 -0000 1.2
@@ -29,6 +29,8 @@
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import org.apache.jetspeed.request.RequestContext;
+
/**
*
*
@@ -92,8 +94,11 @@
}
// TODO Set the prefered locale to user's persistent storage if not
anon user
-
- session.setAttribute(PREFERED_LOCALE_SESSION_KEY, new Locale(language,
country, variant),PortletSession.APPLICATION_SCOPE);
+ Locale preferedLocale = new Locale(language, country, variant);
+ session.setAttribute(RequestContext.PREFERED_LOCALE_SESSION_KEY,
preferedLocale,PortletSession.APPLICATION_SCOPE);
+ RequestContext requestContext = (RequestContext)
request.getAttribute(RequestContext.REQUEST_PORTALENV);
+ requestContext.setLocale(preferedLocale);
+
requestContext.setSessionAttribute(RequestContext.PREFERED_LOCALE_SESSION_KEY,
preferedLocale);
}
return;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]