internationalized user error messages
authorzapata <zapata>
Sun, 9 Mar 2003 05:52:12 +0000 (05:52 +0000)
committerzapata <zapata>
Sun, 9 Mar 2003 05:52:12 +0000 (05:52 +0000)
bundles/admin_en.properties
etc/bundles/open_en.properties
source/Mir.java
source/OpenMir.java
source/mir/servlet/ServletModuleUserExc.java
source/mir/storage/store/StoreContainer.java
source/mir/storage/store/StoreIdentifier.java
source/mircoders/servlet/ServletModuleOpenIndy.java
source/mircoders/servlet/ServletModuleUploadedMedia.java
source/mircoders/servlet/ServletModuleUsers.java

index aae640d..15305c0 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: english
-# $Id: admin_en.properties,v 1.37 2003/03/05 04:33:29 zapata Exp $
+# $Id: admin_en.properties,v 1.38 2003/03/09 05:52:12 zapata Exp $
 
 languagename=English
 
@@ -385,6 +385,7 @@ articletypes.startspecial=Startpage-special
 # Comment status values
 commentstatus.normal=Normal
 
+
 ########## error ##########
 
 error.htmltitle=the system caused an error
@@ -392,11 +393,16 @@ error.title=The system caused an error
 error.text=This can happen. Even if the following error message is not be comprehensible for you, it might be helpful to <a href="mailto:{0}">{1}</a>:
 error.text2=So please send an e-mail with the <font color="Red">red text</font> and detailed information regarding the events that led to this error to <a href="mailto:{0}">{1}</a>. Thanks!
 
-usererror.htmltitle=validation error
-usererror.title=Validation error
+usererror.htmltitle=User error
+usererror.title=User error
 usererror.text=Your input caused the following error:
 usererror.what_to_do=Please press the back button and try it again
 
+media.error.unsupportedformat=The format of the media you uploaded is not supported\r
+user.error.missingpasswords=The new password must be entered twice\r
+user.error.passwordmismatch=The passwords are not equal
+user.error.missingpassword=A password must be entered\r
+
 infomessage.htmltitle = Information
 infomessage.produceAllNewAddedToQueue = Your request has been added to the queue.
 
index 6f5be33..5a24631 100755 (executable)
@@ -5,35 +5,6 @@ langcode=en
 optional=optional
 required=required
 
-comment.htmltitle=Mir | comment
-comment.header=Adding a coment to an article
-comment.password=Password
-comment.note=
-comment.formtitle=Comment 
-comment.title=title of this comment
-comment.name=your name
-comment.email=your eMail
-comment.url=your web site address
-comment.phone=your telephone number.
-comment.address=your address
-comment.language=language of your comment
-comment.text=your comment
-comment.submit=submit comment
-comment.reset=reset form
-
-commentdone.htmltitle=Mir | open posting
-commentdone.thanks=Your comment is on the way!
-commentdone.wait=It will take some minutes until your addition appears under the article.<br>It may take even longer in case of technical problems.<br>
-commentdone.criteria=
-commentdone.stay_calm=Please wait a few minutes
-commentdone.back=Back to the article
-
-commentdupe.htmltitle=Mir | open posting - duplicate entry
-commentdupe.title=Stay calm. Things will happen soon.
-commentdupe.explanation=You probably clicked on the reload button or submitted your comment a second time. The fact that you can read this text means that your comment has been recieved and will soon be included in the article page.
-commentdupe.no_panic=Don't panic
-commentdupe.back=Back to the article
-
 posting.htmltitle=Mir | open posting
 posting.password=Password
 posting.meta.description=Mir CMS system
@@ -70,6 +41,10 @@ posting.submit.info=Please press submit <b>only once</b>!<br>It will appear in a
 posting.criteria=
 posting.submit=Submit (patience is a virtue!)
 posting.reset=Form Reset
+posting.error.missingpassword=The one-time password must be copied into the password field\r
+posting.error.invalidpassword=The one-time password was not copied correctly into the password field\r
+posting.error.missingfield=At least one field was not correctly entered\r
+media.error.unsupportedformat=The format of the media you uploaded is not supported\r
 
 postingdone.htmltitle=open posting
 postingdone.title=You have successfully submitted your article
@@ -83,6 +58,37 @@ postingdupe.explanation=You probably clicked on the reload button or submitted y
 postingdupe.no_panic=Don't panic
 postingdupe.back=Back
 
+comment.htmltitle=Mir | comment
+comment.header=Adding a coment to an article
+comment.password=Password
+comment.note=
+comment.formtitle=Comment 
+comment.title=title of this comment
+comment.name=your name
+comment.email=your eMail
+comment.url=your web site address
+comment.phone=your telephone number.
+comment.address=your address
+comment.language=language of your comment
+comment.text=your comment
+comment.submit=submit comment
+comment.reset=reset form
+comment.error.missingpassword=The one-time password must be copied into the password field\r
+comment.error.invalidpassword=The one-time password was not copied correctly into the password field\r
+
+commentdone.htmltitle=Mir | open posting
+commentdone.thanks=Your comment is on the way!
+commentdone.wait=It will take some minutes until your addition appears under the article.<br>It may take even longer in case of technical problems.<br>
+commentdone.criteria=
+commentdone.stay_calm=Please wait a few minutes
+commentdone.back=Back to the article
+
+commentdupe.htmltitle=Mir | open posting - duplicate entry
+commentdupe.title=Stay calm. Things will happen soon.
+commentdupe.explanation=You probably clicked on the reload button or submitted your comment a second time. The fact that you can read this text means that your comment has been recieved and will soon be included in the article page.
+commentdupe.no_panic=Don't panic
+commentdupe.back=Back to the article
+
 search.info=Results of your search:
 search.title=SEARCH
 search.htmltitle=MirSearch (powered by lucene)
@@ -124,4 +130,9 @@ email.prepare.chooselanguage=The language you want the explanatory text of the f
 email.prepare.send=SEND
 email.sent.htmltitle=Email sent successfully
 email.sent.title=Your email has been sent
-email.sent.text=The aticle has been forwarded to the specified address.
\ No newline at end of file
+email.sent.text=The article has been forwarded to the specified address.
+email.error.invalidtoaddress=The address to send the article to is not valid\r
+email.error.invalidfromaddress=Your email address is not valid\r
+
+
+
index 61ba516..62ae28f 100755 (executable)
@@ -46,6 +46,13 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.struts.util.MessageResources;
+
+import freemarker.template.SimpleHash;
+import freemarker.template.SimpleList;
+import freemarker.template.SimpleScalar;
+import freemarker.template.TemplateModel;
+
 import mir.config.MirPropertiesConfiguration;
 import mir.generator.FreemarkerGenerator;
 import mir.log.LoggerWrapper;
@@ -66,12 +73,6 @@ import mircoders.storage.DatabaseArticleType;
 import mircoders.storage.DatabaseMessages;
 import mircoders.storage.DatabaseUsers;
 
-import org.apache.struts.util.MessageResources;
-
-import freemarker.template.SimpleHash;
-import freemarker.template.SimpleList;
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModel;
 
 
 
@@ -79,7 +80,7 @@ import freemarker.template.TemplateModel;
  * Mir.java - main servlet, that dispatches to servletmodules
  *
  * @author $Author: zapata $
- * @version $Id: Mir.java,v 1.36 2003/03/09 03:53:10 zapata Exp $
+ * @version $Id: Mir.java,v 1.37 2003/03/09 05:52:12 zapata Exp $
  *
  */
 public class Mir extends AbstractServlet {
@@ -356,20 +357,26 @@ public class Mir extends AbstractServlet {
       catch (Exception e) {
         throw new ServletModuleExc("*** error resolving classname for " + moduleName + " -- " + e.getMessage());
       }
-    } else {
+    }
+    else {
       return (ServletModule) servletModuleInstanceHash.get(moduleName);
     }
   }
 
   private void handleUserError(HttpServletRequest aRequest, HttpServletResponse aResponse,
-                               PrintWriter out, Throwable anException) {
+                               PrintWriter out, ServletModuleUserExc anException) {
     try {
       logger.info("user error: " + anException.getMessage());
       SimpleHash modelRoot = new SimpleHash();
-      modelRoot.put("errorstring", new SimpleScalar(anException.getMessage()));
+      MessageResources messages = MessageResources.getMessageResources("bundles.admin");
+      modelRoot.put("errorstring",
+          new SimpleScalar(
+              messages.getMessage(getLocale(aRequest), anException.getMessage(), anException.getParameters())
+          ));
       modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));
-      HTMLTemplateProcessor.process(aResponse,MirPropertiesConfiguration.instance().getString("Mir.UserErrorTemplate"),
-                                    modelRoot, out, aRequest.getLocale() );
+      HTMLTemplateProcessor.process(
+          aResponse,MirPropertiesConfiguration.instance().getString("Mir.UserErrorTemplate"),
+          modelRoot, out, getLocale(aRequest));
       out.close();
     }
     catch (Exception e) {
@@ -387,7 +394,7 @@ public class Mir extends AbstractServlet {
       modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(
                                                new GregorianCalendar())));
       HTMLTemplateProcessor.process(aResponse,MirPropertiesConfiguration.instance().getString("Mir.ErrorTemplate"),
-                                    modelRoot,out, aRequest.getLocale());
+                                    modelRoot,out, getLocale(aRequest));
       out.close();
     }
     catch (Exception e) {
index c3c6108..3ba08b4 100755 (executable)
@@ -39,6 +39,11 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.struts.util.MessageResources;
+
+import freemarker.template.SimpleHash;
+import freemarker.template.SimpleScalar;
+
 import mir.config.MirPropertiesConfiguration;
 import mir.misc.HTMLTemplateProcessor;
 import mir.misc.StringUtil;
@@ -47,14 +52,12 @@ import mir.servlet.ServletModuleDispatch;
 import mir.servlet.ServletModuleUserExc;
 import mir.util.ExceptionFunctions;
 import mircoders.servlet.ServletModuleOpenIndy;
-import freemarker.template.SimpleHash;
-import freemarker.template.SimpleScalar;
 
 /**
  *  OpenMir.java - main servlet for open posting and comment feature to articles
  *
  *  @author RK 1999-2001, the mir-coders group
- *  @version $Id: OpenMir.java,v 1.25 2003/03/09 03:53:10 zapata Exp $
+ *  @version $Id: OpenMir.java,v 1.26 2003/03/09 05:52:12 zapata Exp $
  *
  */
 
@@ -109,14 +112,18 @@ public class OpenMir extends AbstractServlet {
   }
 
   private void handleUserError(HttpServletRequest aRequest, HttpServletResponse aResponse,
-                               PrintWriter out, Throwable anException) {
+                               PrintWriter out, ServletModuleUserExc anException) {
     try {
       logger.info("user error: " + anException.getMessage());
       SimpleHash modelRoot = new SimpleHash();
-      modelRoot.put("errorstring", new SimpleScalar(anException.getMessage()));
+      MessageResources messages = MessageResources.getMessageResources("bundles.open");
+      modelRoot.put("errorstring",
+          new SimpleScalar(
+              messages.getMessage(getLocale(aRequest), anException.getMessage(), anException.getParameters())
+          ));
       modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));
       HTMLTemplateProcessor.process(aResponse,MirPropertiesConfiguration.instance().getString("ServletModule.OpenIndy.UserErrorTemplate"),
-                                    modelRoot, out, aRequest.getLocale() );
+                                    modelRoot, out, getLocale(aRequest));
       out.close();
     }
     catch (Exception e) {
@@ -128,11 +135,12 @@ public class OpenMir extends AbstractServlet {
     try {
       logger.error("error: " + anException);
       SimpleHash modelRoot = new SimpleHash();
+
       modelRoot.put("errorstring", new SimpleScalar(anException.getMessage()));
       modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(
                                                new GregorianCalendar())));
       HTMLTemplateProcessor.process(aResponse,MirPropertiesConfiguration.instance().getString("ServletModule.OpenIndy.ErrorTemplate"),
-                                    modelRoot,out, aRequest.getLocale());
+                                    modelRoot,out, getLocale(aRequest));
       out.close();
     }
     catch (Exception e) {
index 5d42ff3..7eacef0 100755 (executable)
 package mir.servlet;
 
 import multex.Exc;
+/**
+ *
+ * <p>Title: ServletModuleUserExc</p>
+ * <p>Description: </p>
+ * <p>Copyright: Copyright (c) 2003</p>
+ * <p>Company: </p>
+ * @author Zapata
+ * @version 1.0
+ */
 
 public class ServletModuleUserExc extends Exc {
-  public ServletModuleUserExc(String aMessage) {
-    super(aMessage);
+  public ServletModuleUserExc(String aMessageName, String[] aParameterArray) {
+    super(aMessageName, aParameterArray);
   }
 }
index 7ab2073..fcff1f6 100755 (executable)
@@ -52,6 +52,7 @@ import java.util.ListIterator;
 import javax.servlet.http.HttpServletRequest;\r
 \r
 import mir.misc.StringUtil;\r
+import mir.log.LoggerWrapper;\r
 \r
 public class StoreContainer {\r
   private final static int DEFAULT_SIZE = 10;\r
@@ -64,9 +65,12 @@ public class StoreContainer {
   private int hitCount = 0, missCount = 0;\r
   private static ObjectStore o_store = ObjectStore.getInstance();\r
 \r
+  protected LoggerWrapper logger = new LoggerWrapper("Database.ObjectStore");\r
+\r
   // avoid construction without parameters\r
   private StoreContainer() {};\r
 \r
+\r
   public StoreContainer(StoreContainerType stoc_type) {\r
     this.uniqueId = ++uniqueCounter;\r
     this.stocType = stoc_type;\r
@@ -105,8 +109,7 @@ public class StoreContainer {
     if (sid != null && sid.hasReference()) {\r
       if (has(sid)) {\r
         moveToHead(sid);\r
-        System.err.println("OBJECTStore: tried to add sid " + sid.toString() +\r
-                           " that was already in store.");\r
+        logger.error("OBJECTStore: tried to add sid " + sid.toString() + " that was already in store.");\r
       }\r
       else {\r
         container.addFirst(sid);\r
index 6aa4092..91949aa 100755 (executable)
@@ -47,6 +47,7 @@ import java.util.Iterator;
 import java.util.Set;\r
 \r
 import mir.entity.EntityList;\r
+import mir.log.LoggerWrapper;\r
 \r
 public class StoreIdentifier {\r
 \r
@@ -61,6 +62,8 @@ public class StoreIdentifier {
   private long timesUsed;\r
   private boolean invalidating = false;\r
 \r
+  protected LoggerWrapper logger = new LoggerWrapper("Database.ObjectStore");\r
+\r
   /** @todo initialize logfile  */\r
 \r
   private StoreIdentifier() {}\r
@@ -97,14 +100,13 @@ public class StoreIdentifier {
    *  @return\r
    */\r
   public void invalidate() {\r
-    System.out.println("Invalidating: " + toString());\r
+    logger.info("Invalidating: " + toString());\r
     // avoid deadlock due to propagation.\r
     if (!invalidating) {\r
       invalidating = true;\r
       if (stocType != null &&\r
           stocType.getStocType() == StoreContainerType.STOC_TYPE_ENTITY) {\r
-        System.out.println("Propagating invalidation to EntityList for " +\r
-                           toString());\r
+        logger.info("Propagating invalidation to EntityList for " + toString());\r
         // we should invalidate related ENTITY_LIST\r
         StoreContainerType entityListStocType =\r
             StoreContainerType.valueOf(stocType.getStocClass(),\r
@@ -118,14 +120,12 @@ public class StoreIdentifier {
         for (Iterator it = set.iterator(); it.hasNext(); ) {\r
           Object o = it.next();\r
           if (o instanceof StoreIdentifier) {\r
-            System.out.println("Propagating invalidation to StoreIdentifier: " +\r
-                               o.toString());\r
+            logger.info("Propagating invalidation to StoreIdentifier: " + o.toString());\r
             // propagate invalidation to a specific StoreIdentifier in cache\r
             o_store.invalidate( (StoreIdentifier) o);\r
           }\r
           else if (o instanceof StoreContainerType) {\r
-            System.out.println("Propagating invalidation to StoreContainer: " +\r
-                               o.toString());\r
+            logger.info("Propagating invalidation to StoreContainer: " + o.toString());\r
             // propagate invalidation to a whole StoreContainer\r
             o_store.invalidate( (StoreContainerType) o);\r
           }\r
index fd522dd..b87c5d1 100755 (executable)
@@ -119,7 +119,7 @@ import mircoders.storage.DatabaseTopics;
  *    open-postings to the newswire
  *
  * @author mir-coders group
- * @version $Id: ServletModuleOpenIndy.java,v 1.65 2003/03/09 03:53:12 zapata Exp $
+ * @version $Id: ServletModuleOpenIndy.java,v 1.66 2003/03/09 05:52:13 zapata Exp $
  *
  */
 
@@ -239,11 +239,14 @@ public class ServletModuleOpenIndy extends ServletModule
             HttpSession session = req.getSession(false);
             String sessionPasswd = (String)session.getAttribute("passwd");
             if ( sessionPasswd == null){
-              throw new ServletModuleUserExc("Lost password");
+              throw new ServletModuleExc("Lost password");
             }
             String passwd = req.getParameter("passwd");
-            if ( passwd == null || (!sessionPasswd.equals(passwd))) {
-              throw new ServletModuleUserExc("Missing password");
+            if ( passwd == null || passwd.length()==0) {
+              throw new ServletModuleUserExc("comment.error.missingpassword", new String[] {});
+            }
+            if (!sessionPasswd.equals(passwd)) {
+              throw new ServletModuleUserExc("comment.error.invalidpassword", new String[] {});
             }
             session.invalidate();
           }
@@ -254,7 +257,8 @@ public class ServletModuleOpenIndy extends ServletModule
           //insert was not successfull
           if(id==null){
             deliver(req, res, new SimpleHash(), commentFormDupeTemplate);
-          } else {
+          }
+          else {
             DatabaseContent.getInstance().setUnproduced("id="+aid);
 
             try {
@@ -339,8 +343,7 @@ public class ServletModuleOpenIndy extends ServletModule
    *  the postingDone Page
    */
 
-  public void insposting(HttpServletRequest req, HttpServletResponse res)
-      throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure
+  public void insposting(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure
   {
     SimpleHash mergeData = new SimpleHash();
     boolean setMedia=false;
@@ -367,11 +370,14 @@ public class ServletModuleOpenIndy extends ServletModule
         HttpSession session = req.getSession(false);
         String sessionPasswd = (String)session.getAttribute("passwd");
         if ( sessionPasswd == null){
-          throw new ServletModuleUserExc("Lost password");
+          throw new ServletModuleExc("Lost password");
         }
         String passwd = (String)withValues.get("passwd");
-        if ( passwd == null || (!sessionPasswd.equals(passwd))) {
-          throw new ServletModuleUserExc("Missing password");
+        if ( passwd == null || passwd.length()==0) {
+          throw new ServletModuleUserExc("posting.error.missingpassword", new String[] {});
+        }
+        if (!sessionPasswd.equals(passwd)) {
+          throw new ServletModuleUserExc("posting.error.invalidpassword", new String[] {});
         }
         session.invalidate();
       }
@@ -379,7 +385,7 @@ public class ServletModuleOpenIndy extends ServletModule
       if ((((String)withValues.get("title")).length() == 0) ||
           (((String)withValues.get("description")).length() == 0) ||
           (((String)withValues.get("content_data")).length() == 0))
-        throw new ServletModuleUserExc("Missing field");
+        throw new ServletModuleUserExc("posting.error.missingfield", new String[] {});
 
       // call the routines that escape html
 
@@ -464,7 +470,7 @@ public class ServletModuleOpenIndy extends ServletModule
       Throwable cause = ExceptionFunctions.traceCauseException(e);
 
       if (cause instanceof UnsupportedMediaFormatExc) {
-        throw new ServletModuleUserExc("Unsupported media format");
+        throw new ServletModuleUserExc("media.unsupportedformat", new String[] {} );
       }
       throw new ServletModuleFailure(e);
     }
@@ -481,7 +487,7 @@ public class ServletModuleOpenIndy extends ServletModule
   {
     String aid = req.getParameter("mail_aid");
     if (aid == null){
-      throw new ServletModuleUserExc("An article id must be specified in requests to email an article.  Something therefore went badly wrong....");
+      throw new ServletModuleExc("An article id must be specified in requests to email an article.  Something therefore went badly wrong....");
     }
 
     String to = req.getParameter("mail_to");
@@ -504,17 +510,19 @@ public class ServletModuleOpenIndy extends ServletModule
     }
     else {
       //run checks on to and from and mail_language to make sure no monkey business occurring
-      if (mail_language.indexOf('.') != -1 || mail_language.indexOf('/') != -1 ){
-        throw new ServletModuleUserExc("Sorry, you've entered an illegal character into the language field.  Go back and try again, asshole.");
+      if (mail_language.indexOf('.') != -1 || mail_language.indexOf('/') != -1 ) {
+        throw new ServletModuleExc("Invalid language");
       }
       if (to.indexOf('\n') != -1
           || to.indexOf('\r') != -1
-          || to.indexOf(',') != -1
-          || from.indexOf('\n') != -1
-          || from.indexOf('\r') != -1
-          || from.indexOf(',') != -1 ){
-        throw new ServletModuleUserExc("Sorry, you've entered an illegal character into the from or to field.  Go back and try again.");
+          || to.indexOf(',') != -1) {
+        throw new ServletModuleUserExc("email.error.invalidtoaddress", new String[] {to});
+      }
+      if (from.indexOf('\n') != -1 || from.indexOf('\r') != -1 || from.indexOf(',') != -1 ) {
+        throw new ServletModuleUserExc("email.error.invalidfromaddress", new String[] {from});
       }
+
+
       EntityContent contentEnt;
       try{
         contentEnt = (EntityContent)contentModule.getById(aid);
@@ -925,7 +933,7 @@ public class ServletModuleOpenIndy extends ServletModule
           res.getOutputStream().flush();
         }
         else {
-          throw new ServletModuleUserExc("Missing id parameter.");
+          throw new ServletModuleExc("Missing id.");
         }
       }
       catch (Exception ex) {
index 0c15993..e74ada6 100755 (executable)
@@ -72,7 +72,7 @@ import mircoders.storage.DatabaseMediafolder;
  *  ServletModuleBilder -
  *  liefert HTML fuer Bilder
  *
- * @version $Id: ServletModuleUploadedMedia.java,v 1.21 2003/03/09 03:53:12 zapata Exp $
+ * @version $Id: ServletModuleUploadedMedia.java,v 1.22 2003/03/09 05:52:13 zapata Exp $
  * @author RK, the mir-coders group
  */
 
@@ -137,7 +137,7 @@ public abstract class ServletModuleUploadedMedia
       Throwable cause = ExceptionFunctions.traceCauseException(t);
 
       if (cause instanceof UnsupportedMediaFormatExc) {
-        throw new ServletModuleUserExc("Unsupported media format");
+        throw new ServletModuleUserExc("media.error.unsupportedformat", new String[] {});
       }
       throw new ServletModuleFailure("ServletModuleUploadedMedia.insert: " + t.toString(), t);
     }
index 1ad22ea..8087432 100755 (executable)
@@ -115,11 +115,11 @@ public class ServletModuleUsers extends ServletModule
       String newPassword2 = aRequestParser.getParameterWithDefault("newpassword2", "");
 
       if (newPassword.length() == 0 || newPassword2.length() == 0) {
-        throw new ServletModuleUserExc("The new password must be entered twice!");
+        throw new ServletModuleUserExc("user.error.missingpasswords", new String[] {});
       }
 
       if (!newPassword.equals(newPassword2)) {
-        throw new ServletModuleUserExc("New password differes from confirmation");
+        throw new ServletModuleUserExc("user.error.passwordmismatch", new String[] {});
       }
 
       return newPassword;
@@ -139,7 +139,7 @@ public class ServletModuleUsers extends ServletModule
       if (newPassword!=null)
         withValues.put("password", newPassword);
       else
-        throw new ServletModuleUserExc("Password is empty");
+        throw new ServletModuleUserExc("user.error.missingpassword", new String[] {});
 
       String id = mainModule.add(withValues);
       if (requestParser.hasParameter("returnurl"))