OSDN Git Service

Support: Error dialogs I18N.
authorTakuya Ono <takuya-o@users.sourceforge.jp>
Fri, 17 Aug 2007 19:14:57 +0000 (19:14 +0000)
committerTakuya Ono <takuya-o@users.sourceforge.jp>
Fri, 17 Aug 2007 19:14:57 +0000 (19:14 +0000)
src/org/jent/checksmtp/Bundle.properties
src/org/jent/checksmtp/Bundle_ja_JP.properties
src/org/jent/checksmtp/LDAPSearch.java
src/org/jent/checksmtp/Processer.java
src/org/jent/checksmtp/SMTPclient.java
src/org/jent/checksmtp/ToListUI.java

index 204fbb0..55045f0 100644 (file)
@@ -91,8 +91,40 @@ ApplicationUI.jButtonCancel.toolTipText=
 \r
 ApplicationUI.jLabelProgramName.text=Mail Distination Confirm Program\r
 \r
-ApplicationUI.jLabelProgramVersion.text=0.4\r
+ApplicationUI.jLabelProgramVersion.text=0.5 Test Build\r
 \r
 ApplicationUI.jPanelAbout.TabConstraints.tabTitle=About\r
 \r
 ApplicationUI.jLabelSfURL.text=http\://mdc.sourceforge.jp/\r
+\r
+ApplicationUI.Port_number_is_integer_from_1_to_65535.=Port number is integer from 1 to 65535.\r
+\r
+ApplicationUI.shortTitle=mdc\r
+\r
+ApplicationUI.error.Fail_the_properties_file_save.=Fail the properties file save.\r
+\r
+ApplicationUI.error.Out_of_range.=Out of range.\r
+\r
+ToListUI.error.Fail_the_properties_file_of_dialog_potition_save.=Fail the properties file of dialog potition save.\r
+\r
+LDAPSearch.error.LDAPSearch_init_error.=LDAPSearch init error.\r
+\r
+LDAPSearch.error.LDAP_Search_Error.=LDAP Search Error.\r
+\r
+LDAPSearch.error.LDAP_Unexpected_Error.=LDAP Unexpected Error.\r
+\r
+Processer.error.Execption_occurred_at_starting_SMTP_thread.=Execption occurred at starting SMTP thread.\r
+\r
+Processer.error.Runtime_Exception_occurred_in_SMTP_parse=Runtime Exception occurred in SMTP parse\r
+\r
+Processer.error.Error_occurred_in_SMTP_parse.=Error occurred in SMTP parse.\r
+\r
+SMTPClient.error.Recive_Port_bind_error=Recive Port bind error. \r
+\r
+SMTPClient.error.IO_Error_Occurred=I/O Error Occurred. Stop service.\r
+\r
+SMTPClient.error.Argument_Error_Occurted=Stop Service. Argument Error Occurted.\r
+\r
+SMTPCLient.error.Runtime_Exception_was_occurred=Runtime Exception was occurred. Stop service.\r
+\r
+SMTPClient.error.Unexpected_service_stoping_ocurreed=Unexpected service stoping ocurreed. Stoped service.\r
index ac43bab..6ae1e42 100644 (file)
@@ -86,3 +86,35 @@ ApplicationUI.jButtonCancel.toolTipText=\u4ECA\u56DE\u306E\u8A2D\u5B9A\u3092\u30
 ApplicationUI.jLabelProgramName.text=\u30E1\u30FC\u30EB\u9001\u4FE1\u5148\u78BA\u8A8D\u30D7\u30ED\u30B0\u30E9\u30E0\r
 \r
 ApplicationUI.jPanelAbout.TabConstraints.tabTitle=\u60C5\u5831\r
+\r
+ApplicationUI.Port_number_is_integer_from_1_to_65535.=\u30DD\u30FC\u30C8\u756A\u53F7\u306F1\u301C65535\u307E\u3067\u3067\u3059\u3002\r
+\r
+ApplicationUI.error.Fail_the_properties_file_save.=\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u30D5\u30A1\u30A4\u30EB\u306B\u4FDD\u5B58\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\r
+\r
+ApplicationUI.error.Out_of_range.=\u7BC4\u56F2\u304C\u4E0D\u6B63\u3067\u3059\u3002\r
+\r
+ApplicationUI.shortTitle=\u30E1\u30FC\u30EB\u9001\u4FE1\u5148\u78BA\u8A8D\r
+\r
+ToListUI.error.Fail_the_properties_file_of_dialog_potition_save.=\u30C0\u30A4\u30A2\u30ED\u30B0\u306E\u4F4D\u7F6E\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\r
+\r
+LDAPSearch.error.LDAPSearch_init_error.=LDAP\u691C\u7D22\u306E\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\r
+\r
+LDAPSearch.error.LDAP_Search_Error.=LDAP\u691C\u7D22\u3067\u30A8\u30E9\u30FC\r
+\r
+LDAPSearch.error.LDAP_Unexpected_Error.=LDAP\u3067\u4E88\u60F3\u5916\u306E\u30A8\u30E9\u30FC\r
+\r
+Processer.error.Execption_occurred_at_starting_SMTP_thread.=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3068\u306ESMTP\u901A\u4FE1\u306E\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\r
+\r
+Processer.error.Runtime_Exception_occurred_in_SMTP_parse=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3068\u306ESMTP\u901A\u4FE1\u4E2D\u306B\u5B9F\u884C\u6642\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\r
+\r
+Processer.error.Error_occurred_in_SMTP_parse.=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3068\u306ESMTP\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\r
+\r
+SMTPClient.error.Recive_Port_bind_error=\u53D7\u4FE1\u7528\u306E\u30DD\u30FC\u30C8\u306E\u521D\u671F\u5316(bind)\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\r
+\r
+SMTPClient.error.IO_Error_Occurred=\u53D7\u4FE1\u5F85\u3067\u901A\u4FE1\u30A8\u30E9\u30FC\r
+\r
+SMTPClient.error.Argument_Error_Occurted=\u8A2D\u5B9A\u5024\u304C\u6B63\u3057\u304F\u306A\u3044\u305F\u3081\u306B\u53D7\u4FE1\u304C\u3067\u304D\u3066\u3044\u307E\u305B\u3093\u3002\u8A2D\u5B9A\u3092\u5909\u3048\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002\r
+\r
+SMTPCLient.error.Runtime_Exception_was_occurred=\u5B9F\u884C\u6642\u30A8\u30E9\u30FC\u306B\u3088\u308A\u53D7\u4FE1\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3057\u305F\u3002\u8A2D\u5B9A\u3092\u5909\u3048\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002\r
+\r
+SMTPClient.error.Unexpected_service_stoping_ocurreed=\u4E88\u60F3\u5916\u306E\u30A8\u30E9\u30FC\u306B\u3088\u308A\u53D7\u4FE1\u304C\u505C\u6B62\u3057\u3066\u3057\u307E\u3044\u307E\u3057\u305F\u3002\r
index 6f7cb3c..74be464 100644 (file)
@@ -36,12 +36,12 @@ public class LDAPSearch {
           lastProviderUrl = ApplicationProperties.getLdapProviderURL();
           Properties env = new Properties();
           env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
-                          "com.sun.jndi.ldap.LdapCtxFactory");
+                          "com.sun.jndi.ldap.LdapCtxFactory"); // NOI18N
           env.put(Context.PROVIDER_URL, lastProviderUrl);
     
           ctx = new InitialDirContext(env);
         } catch (NamingException e) {
-          String errorMessage = "LDAPSearch init error.";
+          String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("LDAPSearch.error.LDAPSearch_init_error.");
           System.err.println(errorMessage);
           lastProviderUrl = null;
           e.printStackTrace();
@@ -80,13 +80,13 @@ public class LDAPSearch {
     }
     catch (NamingException e)
     {
-      System.err.println("Ignore LDAPSearch close error.");
+      System.err.println("Ignore LDAPSearch close error."); 
       //e.printStackTrace();
     }
   }
   
   public static String search(String mail) {
-    String ans = "";
+    String ans = ""; // NOI18N
 
     if (!ApplicationProperties.getLdap()) {
         return ans;
@@ -99,7 +99,7 @@ public class LDAPSearch {
          init();
     }
     
-    Pattern pattern = Pattern.compile("[ \t]+"); //Attributes separate by space.
+    Pattern pattern = Pattern.compile("[ \t]+"); // NOI18N Attributes separate by space.
     String[] attrNames = pattern.split(ApplicationProperties.getLdapAttributes());
 
     System.err.println("LDAP Serarch= " + mail + " " + attrNames[0]);
@@ -112,7 +112,7 @@ public class LDAPSearch {
 
     try {
       NamingEnumeration mailList = ctx.search(ApplicationProperties.getLdapRoot(),
-                                          "(mail=" + mail + ")", ctrl);
+                                          "(mail=" + mail + ")", ctrl); // NOI18N
 
       while ( mailList.hasMore() ) {
         SearchResult sr = (SearchResult) mailList.next();
@@ -123,19 +123,19 @@ public class LDAPSearch {
           String str;
 
           if (attr == null) {
-              str = "";
+              str = ""; // NOI18N
           } else {
               str = (String) attr.get();
           }
-          if (str == null) { str = "";  }
+          if (str == null) { str = "";  } // NOI18N
 
           if (ApplicationProperties.getLdapIsSjis()) {
-              str = new String(str.getBytes("ISO-8859-1"), "UTF-8");
+              str = new String(str.getBytes("ISO-8859-1"), "UTF-8"); // NOI18N
           }
-          if (i != 0) { ans += " "; }
+          if (i != 0) { ans += " "; } // NOI18N
           ans += str;
         }
-        System.err.println("ANS=" + ans);
+        System.err.println("ANS=" + ans); 
       }
       mailList.close();
     } catch (TimeLimitExceededException tlEx) {
@@ -145,7 +145,7 @@ public class LDAPSearch {
       System.out.println("LDAP Search Name Not Found.");
       //IGNORE Exception
     } catch (NamingException e) {
-      String errorMessage = "LDAP Search Error.";
+      String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("LDAPSearch.error.LDAP_Search_Error.");
       System.err.println(errorMessage);
       e.printStackTrace();
       //ctx reflesh
@@ -156,7 +156,7 @@ public class LDAPSearch {
       System.err.println("LDAP SJIS Error.");
       e.printStackTrace();
     } catch (NullPointerException npEx) { //for failsafe.
-      String errorMessage = "LDAP Unexpected Error.";
+      String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("LDAPSearch.error.LDAP_Unexpected_Error.");
       NullPointerException e = npEx;
       System.err.println(errorMessage);
       e.printStackTrace();
index cb1bcb0..37662dd 100644 (file)
@@ -35,10 +35,10 @@ public class Processer implements Runnable, ResultNotify {
   private final int R502CommandNotImplemented = 502;
 
   //SMTP command
-  private final String COMMAND_RCPT_TO = "RCPT TO:";
-  private final String COMMAND_DATA = "DATA";
-  private final String COMMAND_RESET = "RSET";
-  private final String COMMAND_TURN = "TURN";
+  private final String COMMAND_RCPT_TO = "RCPT TO:"; // NOI18N
+  private final String COMMAND_DATA = "DATA"; // NOI18N
+  private final String COMMAND_RESET = "RSET"; // NOI18N
+  private final String COMMAND_TURN = "TURN"; // NOI18N
 
   //private final String COMMAND_NOOP = "NOOP";
   //private final String COMAMND_QUIT = "QUIT";
@@ -77,12 +77,12 @@ public class Processer implements Runnable, ResultNotify {
                   server.getInputStream()));
       serverWriter = new PrintWriter(new SmtpBufferedWriter(
                   new OutputStreamWriter(server.getOutputStream(),
-                      "ISO-8859-1")), true);
+                      "ISO-8859-1")), true); // NOI18N
       clientReader = new BufferedReader(new InputStreamReader(
                   client.getInputStream()));
       clientWriter = new PrintWriter(new SmtpBufferedWriter(
                   new OutputStreamWriter(client.getOutputStream(),
-                      "ISO-8859-1")), true);
+                      "ISO-8859-1")), true); // NOI18N
 
       smtpStart(serverReader, clientWriter, clientReader, serverWriter);
 
@@ -98,11 +98,11 @@ public class Processer implements Runnable, ResultNotify {
       client.close();
       client = null;
     } catch (IOException e) {
-      String errorMessage = "Execption occurred at starting SMTP thread.";
+      String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Execption_occurred_at_starting_SMTP_thread.");
       System.err.println(errorMessage);
       new MessageDialogUI(errorMessage, e, MessageDialogUI.ERROR_MODE);
     } catch (RuntimeException runEx) {
-      new MessageDialogUI("Runtime Exception occurred in SMTP parse",
+      new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Runtime_Exception_occurred_in_SMTP_parse"),
               runEx, MessageDialogUI.ERROR_MODE);
     } finally {
       //for failsafe Socket close.
@@ -203,7 +203,7 @@ public class Processer implements Runnable, ResultNotify {
             line = clientReader.readLine();
             serverWriter.println(line);
 
-            if (line.equals(".")) {
+            if (line.equals(".")) { // NOI18N
               break; //end of mail dara.
             }
           }
@@ -269,11 +269,11 @@ public class Processer implements Runnable, ResultNotify {
         }
       }
     } catch (IOException e) {
-      String errorMessage = "Error occurred in SMTP parse.";
+      String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Error_occurred_in_SMTP_parse.");
       System.err.println(errorMessage);
       new MessageDialogUI(errorMessage, e, MessageDialogUI.ERROR_MODE);
     } catch (RuntimeException runEx) {
-      new MessageDialogUI("Runtime Exception occurred in SMTP parse",
+      new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Runtime_Exception_occurred_in_SMTP_parse"),
               runEx, MessageDialogUI.ERROR_MODE);
     }
 
@@ -285,18 +285,18 @@ public class Processer implements Runnable, ResultNotify {
 
     //Splitting Mail address.
     String str = line.substring(COMMAND_RCPT_TO.length() + 1);
-    Pattern pattern = Pattern.compile("[< >]+");
+    Pattern pattern = Pattern.compile("[< >]+"); // NOI18N
     String[] address = pattern.split(str); // 0<1>2 3
     int i;
 
     for (i = 0; i < address.length; i++) {
-      if (!address[i].equals("")) {
+      if (!address[i].equals("")) { // NOI18N
         break;
       }
     }
 
     //Search LDAP
-    str = address[i] + " " + LDAPSearch.search(address[i]);
+    str = address[i] + " " + LDAPSearch.search(address[i]); // NOI18N
     return str;
   }
 }
index b54ac54..2c6912a 100644 (file)
@@ -57,14 +57,14 @@ public class SMTPclient implements Runnable {
           }
         } catch (BindException bindEx) {
           //fatalError = true;
-          String errorMessage = "Recive Port bind error. " + bindEx.getMessage();
+          String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.Recive_Port_bind_error") + bindEx.getMessage();
           System.err.println(errorMessage);
           bindEx.printStackTrace();
           new MessageDialogUI(errorMessage, bindEx, MessageDialogUI.ERROR_MODE);
           break;
         } catch (IOException e) {
           fatalError = true;
-          String errorMessage = "I/O Error Occurred. Stop service.";
+          String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.IO_Error_Occurred");
           System.err.println(errorMessage);
           e.printStackTrace();
           new MessageDialogUI(errorMessage, e, MessageDialogUI.ERROR_MODE);
@@ -72,8 +72,7 @@ public class SMTPclient implements Runnable {
         } catch (IllegalArgumentException iaEx) {
           //Port value out of range
           fatalError = true;
-          String errorMessage = "Argument Error Occurted(" + iaEx.getMessage() +
-                  "). Stop service.";
+          String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.Argument_Error_Occurted") + iaEx.getMessage();
           System.err.println(errorMessage);
           iaEx.printStackTrace();
           new MessageDialogUI(errorMessage, iaEx, MessageDialogUI.ERROR_MODE);
@@ -113,7 +112,7 @@ public class SMTPclient implements Runnable {
         }
       } catch (RuntimeException rEx) {
         fatalError = true;
-        String errorMessage = "Runtime Exception was occurred. Stop service.";
+        String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPCLient.error.Runtime_Exception_was_occurred");
         System.err.println(errorMessage);
         new MessageDialogUI(errorMessage, rEx, MessageDialogUI.ERROR_MODE);
         break;
@@ -121,7 +120,7 @@ public class SMTPclient implements Runnable {
     }
     if ( !fatalError ) {
       //Servce stop by non fatal error. Unexpected.
-      String errorMessage = "Unexpected service stoping ocurreed. Stoped service.";
+      String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.Unexpected_service_stoping_ocurreed");
       System.err.println(errorMessage);
       new MessageDialogUI(errorMessage, null, MessageDialogUI.ERROR_MODE);
     }
index c17496c..2ce629f 100644 (file)
@@ -194,7 +194,7 @@ public class ToListUI extends javax.swing.JFrame {
       ApplicationProperties.setConfirmDialogPosH(h);
       ApplicationProperties.setConfirmDialogPosW(w);
       if ( !ApplicationProperties.save() ) {
-        new MessageDialogUI("Fail the properties file of dialog potition save.",
+        new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ToListUI.error.Fail_the_properties_file_of_dialog_potition_save."),
                 null, MessageDialogUI.ERROR_MODE);
       }
     }