Hi folks.
For our own purposes we translated two dialogs to german, and added a
configuration parameter named "Language" to switch between languages.
Perhaps this is of interest to someone else, or perhaps it even gets
integrated in the trunk.

Thanks for listening.
Daniel Rauer, bytemine
--- Session.java	2010-02-04 23:54:55.000000000 +0100
+++ Session.java.orig	2010-02-13 13:34:00.000000000 +0100
@@ -655,52 +655,23 @@
       boolean b=false;
 
       if(userinfo!=null){
-          String language = getConfig("Language");
-          if (language == null)
-              language = "en";
-          
-          String message = "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!\n"
-                  + "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
-                  + "Someone could be eavesdropping on you right now (man-in-the-middle attack)!\n"
-                  + "It is also possible that the "
-                  + key_type
-                  + " host key has just been changed.\n"
-                  + "The fingerprint for the "
-                  + key_type
-                  + " key sent by the remote host is\n"
-                  + key_fprint
-                  + ".\n"
-                  + "Please contact your system administrator.\n"
-                  + "Add correct host key in "
-                  + file
-                  + " to get rid of this message.";
-          String message2 = "\nDo you want to delete the old key and insert the new key?";
-          
-          if ("de".equals(language)) {
-              message = "WARNUNG: DIE IDENTITÄT DES SERVERS HAT SICH GEÄNDERT!\n" 
-                  + "Jemand könnte eine man-in-the-middle Attack durchführen!\n"
-                  + "Es könnte auch sein, dass sich einfach der "
-                  + key_type
-                  + " Schlüssel des Servers geändert hat.\n"
-                  + "Der Fingerabdruck für den "
-                  + key_type
-                  + " Schlüssel, der vom Server gesendet wurde, lautet\n"
-                  + key_fprint
-                  + ".\n"
-                  + "Bitte kontaktieren Sie Ihren Systemadministrator.\n"
-                  + "Fügen Sie den korrekten Schlüssel hier ein: "
-                  + file
-                  + ", damit die Nachricht nicht wieder angezeigt wird.";
-              message2 = "\nMöchten Sie den alten Schlüssel löschen und den neuen einfügen?";
-          }
-          
-          if (shkc.equals("ask")) {
-              b = userinfo
-                      .promptYesNo(message
-                              + message2);
-          } else { // shkc.equals("yes")
-              userinfo.showMessage(message);
-          }
+        String message=
+"WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!\n"+
+"IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"+
+"Someone could be eavesdropping on you right now (man-in-the-middle attack)!\n"+
+"It is also possible that the "+key_type+" host key has just been changed.\n"+
+"The fingerprint for the "+key_type+" key sent by the remote host is\n"+
+key_fprint+".\n"+
+"Please contact your system administrator.\n"+
+"Add correct host key in "+file+" to get rid of this message.";
+
+        if(shkc.equals("ask")){
+          b=userinfo.promptYesNo(message+
+                                 "\nDo you want to delete the old key and insert the new key?");
+        }
+        else{  // shkc.equals("yes")
+          userinfo.showMessage(message);
+        }
       }
 
       if(!b){
@@ -722,26 +693,15 @@
       }
       //System.err.println("finger-print: "+key_fprint);
       if(userinfo!=null){
-          String language = getConfig("Language");
-          if (language == null)
-              language = "en";
-          
-          String message = "The authenticity of host '"
-              + host + "' can't be established.\n" + key_type
-              + " key fingerprint is " + key_fprint + ".\n"
-              + "Are you sure you want to continue connecting?";
-          if ("de".equals(language)) {
-              message = "Die Echtheit des Servers '"
-                  + host + "' konnte nicht bestätigt werden.\n"
-                  + "Der Fingerabdruck des " + key_type + " Schlüssels lautet " + key_fprint + ".\n"
-                  + "Möchten Sie fortfahren?";
-          }
-          
-          boolean foo = userinfo.promptYesNo(message);
-          if (!foo) {
-              throw new JSchException("reject HostKey: " + host);
-          }
-          insert = true;
+	boolean foo=userinfo.promptYesNo(
+"The authenticity of host '"+host+"' can't be established.\n"+
+key_type+" key fingerprint is "+key_fprint+".\n"+
+"Are you sure you want to continue connecting?"
+					 );
+	if(!foo){
+	  throw new JSchException("reject HostKey: "+host);
+	}
+	insert=true;
       }
       else{
 	if(i==HostKeyRepository.NOT_INCLUDED) 
--- JSch.java	2010-02-04 23:55:21.000000000 +0100
+++ JSch.java.orig	2010-02-13 13:33:28.000000000 +0100
@@ -107,8 +107,6 @@
     config.put("PreferredAuthentications", "gssapi-with-mic,publickey,keyboard-interactive,password");
 
     config.put("CheckCiphers", "aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256");
-    
-    config.put("Language",  "en");
   }
   java.util.Vector pool=new java.util.Vector();
   java.util.Vector identities=new java.util.Vector();
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to