You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2006/01/14 20:08:01 UTC

svn commit: r369081 - /incubator/roller/trunk/web/taglibs.jsp

Author: agilliland
Date: Sat Jan 14 11:07:54 2006
New Revision: 369081

URL: http://svn.apache.org/viewcvs?rev=369081&view=rev
Log:
fix the way the jstl fmt locale is set so that the editing interface is based on the locale selected by the user who is logged in.


Modified:
    incubator/roller/trunk/web/taglibs.jsp

Modified: incubator/roller/trunk/web/taglibs.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/taglibs.jsp?rev=369081&r1=369080&r2=369081&view=diff
==============================================================================
--- incubator/roller/trunk/web/taglibs.jsp (original)
+++ incubator/roller/trunk/web/taglibs.jsp Sat Jan 14 11:07:54 2006
@@ -30,10 +30,21 @@
 <%@ page import="org.roller.presentation.LanguageUtil" %>
 
 <%   
-// fmt:setLocale doesn't accept an expression, hence this hack
-Config.set(pageContext, Config.FMT_LOCALE, 
-        LanguageUtil.getViewLocale(request), pageContext.PAGE_SCOPE); 
+// see if we have an authenticated user so we can set the display locale
+RollerSession rSession = RollerSession.getRollerSession(request);
+UserData mUser = null;
+if(rSession != null) {
+    mUser = rSession.getAuthenticatedUser();
+}
+
+if(mUser != null) {
+    request.setAttribute("mLocale", mUser.getLocale());
+} else {
+    request.setAttribute("mLocale", 
+            LanguageUtil.getViewLocale(request).getDisplayName());
+}
 %>
+<fmt:setLocale value="${mLocale}" />
 <fmt:setBundle basename="ApplicationResources" />
 
 <%-- Set Struts tags to use XHTML --%>