Author: metskem
Date: Mon Nov  3 11:38:48 2008
New Revision: 710142

URL: http://svn.apache.org/viewvc?rev=710142&view=rev
Log:
2.8.1-svn-4 JSPWIKI-407: Unlocalized messages and times in user, group and 
attachment management, reported by Olivier Descout .  en and nl languages are 
up to date, the others not (yet).

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources.properties
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources_nl.properties
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/ListLocksPlugin.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupContent.jsp
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupTab.jsp

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Mon Nov  3 11:38:48 
2008
@@ -1,3 +1,10 @@
+2008-11-03  Harry Metske <[EMAIL PROTECTED]>
+
+        * 2.8.1-svn-4
+        
+        * JSPWIKI-407: Unlocalized messages and times in user, group and 
attachment
+           management, reported by Olivier Descout (Forbidden.html not fixed 
yet)      
+
 2008-11-02  Janne Jalkanen <[EMAIL PROTECTED]>
 
         * 2.8.1-svn-3

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties 
(original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources.properties 
Mon Nov  3 11:38:48 2008
@@ -196,3 +196,14 @@
 
 # RSSImageLinkTag
 rss.title=RSS feed for page {0}
+
+# AttachmentManager
+attach.unwanted.file=Unwanted file name.
+attach.empty.file=Empty file name given.
+attach.parent.not.exist=Parent page does not exist
+
+# VariableManager
+varmgr.not.logged.in=not logged in
+varmgr.authenticated=authenticated
+varmgr.asserted=asserted
+varmgr.anonymous=anonymous

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/CoreResources_nl.properties
 Mon Nov  3 11:38:48 2008
@@ -195,4 +195,16 @@
 install.installer.validate.logdir=Je moet de log directory opgeven.
 
 # RSSImageLinkTag
-rss.title=RSS feed voor pagina {0}
\ No newline at end of file
+rss.title=RSS feed voor pagina {0}
+
+
+# AttachmentManager
+attach.unwanted.file=Ongewenste bestandsnaam
+attach.empty.file=Geen bestandsnaam opgegeven
+attach.parent.not.exist=De parent pagina bestaat niet
+
+# VariableManager
+varmgr.not.logged.in=niet ingelogd
+varmgr.authenticated=geauthenticeerd
+varmgr.asserted=aangenomen identiteit
+varmgr.anonymous=anoniem

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources.properties
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources.properties?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources.properties
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources.properties
 Mon Nov  3 11:38:48 2008
@@ -46,4 +46,11 @@
 formoutput.missingargument = Argument &#39;{0}&#39; required for Form plugin
 formselect.namemissing = Select element is missing parameter &#39;name&#39;.
 formtextarea.noneedtoshow = (no need to show textarea field now)
-formtextarea.namemissing = Textarea element is missing parameter 
&#39;name&#39;.
\ No newline at end of file
+formtextarea.namemissing = Textarea element is missing parameter 
&#39;name&#39;.
+
+# ListLocks plugin
+plugin.listlocks.page=Page
+plugin.listlocks.locked.by=Locked by
+plugin.listlocks.acquired=Acquired
+plugin.listlocks.expires=Expires
+plugin.listlocks.no.locks.exist=No locks exist currently.
\ No newline at end of file

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources_nl.properties
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources_nl.properties?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources_nl.properties
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/etc/i18n/plugin/PluginResources_nl.properties
 Mon Nov  3 11:38:48 2008
@@ -55,3 +55,10 @@
 formselect.namemissing=Het element 'select' verwacht een parameter 'name'.
 formtextarea.noneedtoshow=(form textarea is hier niet nodig)
 formtextarea.namemissing=Het element 'textarea' verwacht de parameter 'name'.
+
+# ListLocks plugin
+plugin.listlocks.page=Pagina
+plugin.listlocks.locked.by=In gebruik door
+plugin.listlocks.acquired=Sinds
+plugin.listlocks.expires=Loopt af
+plugin.listlocks.no.locks.exist=Er zijn momenteel geen locks.
\ No newline at end of file

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
 Mon Nov  3 11:38:48 2008
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "3";
+    public static final String     BUILD         = "4";
     
     /**
      *  This is the generic version string you should use

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java
 Mon Nov  3 11:38:48 2008
@@ -22,10 +22,7 @@
 
 import java.lang.reflect.Method;
 import java.security.Principal;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
+import java.util.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
@@ -33,6 +30,7 @@
 import org.apache.log4j.Logger;
 
 import com.ecyrd.jspwiki.filters.PageFilter;
+import com.ecyrd.jspwiki.i18n.InternationalizationManager;
 import com.ecyrd.jspwiki.modules.InternalModule;
 
 /**
@@ -481,14 +479,15 @@
         public String getLoginstatus()
         {
             WikiSession session = m_context.getWikiSession();
-            return session.getStatus();
+            return 
m_context.getBundle(InternationalizationManager.CORE_BUNDLE).getString( 
"varmgr." + session.getStatus());
         }
 
         public String getUsername()
         {
             Principal wup = m_context.getCurrentUser();
-
-            return wup != null ? wup.getName() : "not logged in";
+            
+            ResourceBundle rb = m_context.getBundle( 
InternationalizationManager.CORE_BUNDLE );
+            return wup != null ? wup.getName() : rb.getString( 
"varmgr.not.logged.in" );
         }
 
         public String getRequestcontext()

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
 Mon Nov  3 11:38:48 2008
@@ -487,7 +487,8 @@
         //
         if( !m_engine.getPageManager().pageExists( att.getParentName() ) )
         {
-            throw new ProviderException("Parent page does not exist");
+            // the caller should catch the exception and use the exception 
text as an i18n key
+            throw new ProviderException(  "attach.parent.not.exist"  );
         }
         
         m_provider.putAttachmentData( att, in );
@@ -603,9 +604,10 @@
     {
         if( filename == null || filename.trim().length() == 0 )
         {
-            AttachmentServlet.log.error("Empty file name given.");
+            log.error("Empty file name given.");
     
-            throw new WikiException("Empty file name given.");
+            // the caller should catch the exception and use the exception 
text as an i18n key
+            throw new WikiException(  "attach.empty.file" );
         }
     
         //
@@ -618,8 +620,9 @@
         {
             log.info( "Attempt to upload a file with a .jsp/.jspf extension.  
In certain cases this" +
                        " can trigger unwanted security side effects, so we're 
preventing it." );
-            
-            throw new WikiException( "Unwanted file name." );
+            //
+            // the caller should catch the exception and use the exception 
text as an i18n key
+            throw new WikiException(  "attach.unwanted.file"  );
         }
     
         //

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
 Mon Nov  3 11:38:48 2008
@@ -54,6 +54,7 @@
 import com.ecyrd.jspwiki.dav.methods.DavMethod;
 import com.ecyrd.jspwiki.dav.methods.PropFindMethod;
 import com.ecyrd.jspwiki.filters.RedirectException;
+import com.ecyrd.jspwiki.i18n.InternationalizationManager;
 import com.ecyrd.jspwiki.providers.ProviderException;
 import com.ecyrd.jspwiki.ui.progress.ProgressItem;
 import com.ecyrd.jspwiki.util.HttpUtil;
@@ -723,8 +724,9 @@
         }
         catch( WikiException e )
         {
-            log.error( "Illegal filename given: "+e.getMessage() );
-            throw new RedirectException( e.getMessage(), errorPage );
+            // this is a kludge, the exception that is caught here contains 
the i18n key
+            // here we have the context available, so we can internationalize 
it properly :
+            throw new RedirectException(context.getBundle( 
InternationalizationManager.CORE_BUNDLE ).getString( e.getMessage() ), 
errorPage );
         }
         
         //
@@ -800,8 +802,14 @@
             {
                 att.setAttribute( WikiPage.CHANGENOTE, changenote );
             }
-
+            
+            try {
             m_engine.getAttachmentManager().storeAttachment( att, data );
+            } catch (ProviderException pe) {
+                // this is a kludge, the exception that is caught here 
contains the i18n key
+                // here we have the context available, so we can 
internationalize it properly :
+                throw new ProviderException( context.getBundle( 
InternationalizationManager.CORE_BUNDLE ).getString( pe.getMessage() ) );
+            }
 
             log.info( "User " + user + " uploaded attachment to " + parentPage 
+
                       " called "+filename+", size " + att.getSize() );

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/ListLocksPlugin.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/ListLocksPlugin.java?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/ListLocksPlugin.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/ListLocksPlugin.java
 Mon Nov  3 11:38:48 2008
@@ -44,15 +44,19 @@
 
         PageManager mgr = context.getEngine().getPageManager();
         List locks = mgr.getActiveLocks();
+        ResourceBundle rb = 
context.getBundle(WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
 
         result.append("<table class=\"wikitable\">\n");
         result.append("<tr>\n");
-        result.append("<th>Page</th><th>Locked 
by</th><th>Acquired</th><th>Expires</th>\n");
+        result.append( "<th>" + rb.getString( "plugin.listlocks.page" ) + 
"</th><th>" + rb.getString( "plugin.listlocks.locked.by" )
+                       + "</th><th>" + rb.getString( 
"plugin.listlocks.acquired" ) + "</th><th>"
+                       + rb.getString( "plugin.listlocks.expires" ) + 
"</th>\n" );
         result.append("</tr>");
 
         if( locks.size() == 0 )
         {
-            result.append("<tr><td colspan=\"4\" class=\"odd\">No locks exist 
currently.</td></tr>\n");
+            result.append( "<tr><td colspan=\"4\" class=\"odd\">" + 
rb.getString( "plugin.listlocks.no.locks.exist" )
+                           + "</td></tr>\n" );
         }
         else
         {

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupContent.jsp
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupContent.jsp?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupContent.jsp
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupContent.jsp
 Mon Nov  3 11:38:48 2008
@@ -6,6 +6,7 @@
 <%@ page import="com.ecyrd.jspwiki.auth.PrincipalComparator" %>
 <%@ page import="com.ecyrd.jspwiki.auth.authorize.Group" %>
 <%@ page import="com.ecyrd.jspwiki.auth.authorize.GroupManager" %>
+<%@ page import="com.ecyrd.jspwiki.preferences.Preferences" %>
 <%@ page import="org.apache.log4j.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
@@ -35,12 +36,12 @@
     creator = group.getCreator();
     if ( group.getCreated() != null )
     {
-      created = group.getCreated().toString();
+      created = Preferences.renderDate(WikiContext.findContext( pageContext ), 
group.getCreated(),Preferences.TimeFormat.DATETIME);
     }
     modifier = group.getModifier();
     if ( group.getLastModified() != null )
     {
-      modified = group.getLastModified().toString();
+      modified = Preferences.renderDate(WikiContext.findContext( pageContext 
), group.getLastModified(),Preferences.TimeFormat.DATETIME) ; 
     }
   }
   name = TextUtil.replaceEntities(name);

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupTab.jsp
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupTab.jsp?rev=710142&r1=710141&r2=710142&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupTab.jsp
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/default/GroupTab.jsp
 Mon Nov  3 11:38:48 2008
@@ -7,6 +7,7 @@
 <%@ page import="com.ecyrd.jspwiki.auth.PrincipalComparator" %>
 <%@ page import="com.ecyrd.jspwiki.auth.authorize.Group" %>
 <%@ page import="com.ecyrd.jspwiki.auth.authorize.GroupManager" %>
+<%@ page import="com.ecyrd.jspwiki.preferences.Preferences" %>
 <%@ page import="org.apache.log4j.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
@@ -34,11 +35,11 @@
       
       ss.append( delim );
       mf = new MessageFormat(LocaleSupport.getLocalizedMessage(pageContext, 
"grp.createdon") );
-      args = new Object[]{(group.getCreated()==null) ? "" : 
group.getCreated().toString(), group.getCreator()};
+      args = new Object[]{(group.getCreated()==null) ? "" : 
Preferences.renderDate(WikiContext.findContext( pageContext ), 
group.getCreated(),Preferences.TimeFormat.DATETIME), group.getCreator()};
       ss.append( mf.format( args ) );
       
       mf = new MessageFormat(LocaleSupport.getLocalizedMessage(pageContext, 
"grp.lastmodified") );
-      args = new Object[]{(group.getCreated()==null) ? "" : 
group.getCreated().toString(), group.getModifier()};
+      args = new Object[]{(group.getLastModified()==null) ? "" : 
Preferences.renderDate(WikiContext.findContext( pageContext ), 
group.getLastModified(),Preferences.TimeFormat.DATETIME), group.getModifier()};
       ss.append( mf.format( args ) );
       
       ss.append( "\", " );


Reply via email to