]> WPIA git - gigi.git/commitdiff
Cleanup additional tranlation.
authorFelix Dörre <felix@dogcraft.de>
Thu, 19 May 2016 10:17:29 +0000 (12:17 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 29 May 2016 00:16:40 +0000 (02:16 +0200)
Change-Id: Ib935ae46975c9c51137d20c3ef8cf6f57e91e2d7

src/org/cacert/gigi/pages/OneFormPage.java
src/org/cacert/gigi/pages/admin/support/FindDomainForm.java
src/org/cacert/gigi/pages/admin/support/FindUserForm.java
src/org/cacert/gigi/pages/main/Signup.java
src/org/cacert/gigi/util/Notary.java

index e61511dc097c4e8e863bfb02dfa247d151e5943f..c1e075cbac73ef6cbebee8e20f7c1fc5707aff0e 100644 (file)
@@ -36,7 +36,7 @@ public abstract class OneFormPage extends Page {
         try {
             c.getConstructor(HttpServletRequest.class).newInstance(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
         } catch (ReflectiveOperationException e) {
         try {
             c.getConstructor(HttpServletRequest.class).newInstance(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
         } catch (ReflectiveOperationException e) {
-            new GigiApiException(e.getMessage()).format(resp.getWriter(), getLanguage(req));
+            new GigiApiException().format(resp.getWriter(), getLanguage(req));
         }
     }
 
         }
     }
 
index f40855141921e8aab6cd68c66adb8ec2ac56509a..aafd5b9d6ef807f652534859d72cbaa83bfc815f 100644 (file)
@@ -1,6 +1,7 @@
 package org.cacert.gigi.pages.admin.support;
 
 import java.io.PrintWriter;
 package org.cacert.gigi.pages.admin.support;
 
 import java.io.PrintWriter;
+import java.util.Arrays;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -10,6 +11,7 @@ import org.cacert.gigi.dbObjects.CertificateOwner;
 import org.cacert.gigi.dbObjects.Domain;
 import org.cacert.gigi.localisation.Language;
 import org.cacert.gigi.output.template.Form;
 import org.cacert.gigi.dbObjects.Domain;
 import org.cacert.gigi.localisation.Language;
 import org.cacert.gigi.output.template.Form;
+import org.cacert.gigi.output.template.SprintfCommand;
 import org.cacert.gigi.output.template.Template;
 
 public class FindDomainForm extends Form {
 import org.cacert.gigi.output.template.Template;
 
 public class FindDomainForm extends Form {
@@ -33,13 +35,13 @@ public class FindDomainForm extends Form {
             try {
                 d = Domain.getById(Integer.parseInt(request.substring(1)));
             } catch (IllegalArgumentException e) {
             try {
                 d = Domain.getById(Integer.parseInt(request.substring(1)));
             } catch (IllegalArgumentException e) {
-                throw (new GigiApiException("No personal domains found matching the id " + request.substring(1) + "."));
+                throw (new GigiApiException(new SprintfCommand("No personal domains found matching the id %s", Arrays.asList(request.substring(1)))));
             }
         } else {
             d = Domain.searchUserIdByDomain(request);
         }
         if (d == null) {
             }
         } else {
             d = Domain.searchUserIdByDomain(request);
         }
         if (d == null) {
-            throw (new GigiApiException("No personal domains found matching " + request));
+            throw (new GigiApiException(new SprintfCommand("No personal domains found matching %s", Arrays.asList(request))));
         }
         res = d.getOwner();
         return true;
         }
         res = d.getOwner();
         return true;
index 17799e3bbfbfe2e3a41a658c9d2eb498cfbafb9b..d88f93ab5d15ee77d5820f495a72e4b6b6e200e2 100644 (file)
@@ -1,6 +1,7 @@
 package org.cacert.gigi.pages.admin.support;
 
 import java.io.PrintWriter;
 package org.cacert.gigi.pages.admin.support;
 
 import java.io.PrintWriter;
+import java.util.Arrays;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -9,6 +10,7 @@ import org.cacert.gigi.GigiApiException;
 import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.localisation.Language;
 import org.cacert.gigi.output.template.Form;
 import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.localisation.Language;
 import org.cacert.gigi.output.template.Form;
+import org.cacert.gigi.output.template.SprintfCommand;
 import org.cacert.gigi.output.template.Template;
 
 public class FindUserForm extends Form {
 import org.cacert.gigi.output.template.Template;
 
 public class FindUserForm extends Form {
@@ -28,7 +30,7 @@ public class FindUserForm extends Form {
     public boolean submit(PrintWriter out, HttpServletRequest req) throws GigiApiException {
         User[] users = User.findByEmail(req.getParameter("email"));
         if (users.length == 0) {
     public boolean submit(PrintWriter out, HttpServletRequest req) throws GigiApiException {
         User[] users = User.findByEmail(req.getParameter("email"));
         if (users.length == 0) {
-            throw (new GigiApiException("No users found matching " + req.getParameter("email")));
+            throw (new GigiApiException(new SprintfCommand("No users found matching %s", Arrays.asList(req.getParameter("email")))));
         }
         this.users = users;
         return true;
         }
         this.users = users;
         return true;
index 27566aeee9619c32b5db8bcb19faedd36d644ad8..0cadcf64a8c4575b9d94831c59c0b95c43e5e69d 100644 (file)
@@ -167,7 +167,7 @@ public class Signup extends Form {
         } catch (SQLException e) {
             e.printStackTrace();
         } catch (GigiApiException e) {
         } catch (SQLException e) {
             e.printStackTrace();
         } catch (GigiApiException e) {
-            outputError(out, req, e.getMessage());
+            e.format(out, Page.getLanguage(req));
             return false;
         }
         return true;
             return false;
         }
         return true;
index 24118fc3678f4f738818b0fbd7b95cdc738b62f3..144bf6d88a464a0ffa9a8367dc6435992b06b1fb 100644 (file)
@@ -1,6 +1,7 @@
 package org.cacert.gigi.util;
 
 import java.text.ParseException;
 package org.cacert.gigi.util;
 
 import java.text.ParseException;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
@@ -13,6 +14,7 @@ import org.cacert.gigi.dbObjects.Group;
 import org.cacert.gigi.dbObjects.Name;
 import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.output.DateSelector;
 import org.cacert.gigi.dbObjects.Name;
 import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.output.DateSelector;
+import org.cacert.gigi.output.template.SprintfCommand;
 
 public class Notary {
 
 
 public class Notary {
 
@@ -135,7 +137,7 @@ public class Notary {
             } else if (type == AssuranceType.TTP_ASSISTED) {
                 assureTTP(assurer, assuree, awarded, location, date);
             } else {
             } else if (type == AssuranceType.TTP_ASSISTED) {
                 assureTTP(assurer, assuree, awarded, location, date);
             } else {
-                throw new GigiApiException("Unknown Assurance type: " + type);
+                throw new GigiApiException(new SprintfCommand("Unknown Assurance type: %s", Arrays.asList(type.toString())));
             }
             assurer.invalidateMadeAssurances();
             assuree.invalidateReceivedAssurances();
             }
             assurer.invalidateMadeAssurances();
             assuree.invalidateReceivedAssurances();