diff options
author | Kenny Root <kenny@the-b.org> | 2009-06-27 05:40:50 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2009-06-27 05:40:50 +0000 |
commit | a3b3e8b14c5a9468aafc1925b3e9763a56269472 (patch) | |
tree | 54a8687be76063dbd1bcde0bcab5bbe9fc5ef088 | |
parent | 9184616dc5e0c02d646a0dd6d86b97567f1810f6 (diff) | |
download | connectbot-a3b3e8b14c5a9468aafc1925b3e9763a56269472.tar.gz connectbot-a3b3e8b14c5a9468aafc1925b3e9763a56269472.tar.bz2 connectbot-a3b3e8b14c5a9468aafc1925b3e9763a56269472.zip |
Externalize the last few strings lingering in SSH and TerminalBridge
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@339 df292f66-193f-0410-a5fc-6d59da041ff2
-rw-r--r-- | res/values/strings.xml | 20 | ||||
-rw-r--r-- | src/org/connectbot/service/TerminalBridge.java | 2 | ||||
-rw-r--r-- | src/org/connectbot/transport/SSH.java | 28 |
3 files changed, 33 insertions, 17 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 1cc691c..44b6832 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -307,7 +307,7 @@ <string name="list_format_error">Use the format "%1$s"</string> <!-- Part of the formatting hints that will be used like: username@hostname:port --> - <string name="format_username">username</string> + <string name="format_username">username</string> <!-- Part of the formatting hints that will be used like: username@hostname:port --> <string name="format_hostname">hostname</string> <!-- Part of the formatting hints that will be used like: username@hostname:port --> @@ -360,23 +360,39 @@ <string name="terminal_no_hosts_connected">No hosts currently connected</string> + <!-- Displayed in terminal when attempting to connect to a host. The first two + variables are host:port and the third is the protocol (e.g., SSH) --> + <string name="terminal_connecting">Connecting to %1$s:%2$d via %3$s</string> + + <!-- Displays the host key to the user in the terminal --> + <string name="terminal_sucess">Verified host '%1$s' key: %2$s</string> <string name="terminal_failed">Host key verification failed.</string> + <!-- Displayed on the terminal describing the cryptographic algorithm names --> + <string name="terminal_using_s2c_algorithm">Server-to-client algorithm: %1$s %2$s</string> + <!-- Displayed on the terminal describing the cryptographic algorithm names --> + <string name="terminal_using_c2s_algorithm">Client-to-server algorithm: %1$s %2$s</string> + <!-- Displayed on the terminal describing the cryptographic algorithm names --> + <string name="terminal_using_algorithm">Using algorithm: %1$s %2$s</string> + <string name="terminal_auth">Trying to authenticate</string> <string name="terminal_auth_pass">Attempting 'password' authentication</string> - <string name="terminal_auth_pass_hint">Password</string> <string name="terminal_auth_pass_fail">Authentication method 'password' failed</string> <string name="terminal_auth_pubkey_any">Attempting 'publickey' authentication with any in-memory public keys</string> <string name="terminal_auth_pubkey_invalid">Selected public key is invalid, try reselecting key in host editor</string> <string name="terminal_auth_pubkey_specific">Attempting 'publickey' authentication with a specific public key</string> + <string name="terminal_auth_pubkey_fail">Authentication method 'publickey' with key '%1$s' failed</string> <string name="terminal_auth_ki">Attempting 'keyboard-interactive' authentication</string> <string name="terminal_auth_ki_fail">Authentication method 'keyboard-interactive' failed</string> <string name="terminal_auth_fail">[Your host doesn't support 'password' or 'keyboard-interactive' authentication.]</string> + <string name="terminal_no_session">Session will not be started due to host preference.</string> + <string name="terminal_enable_portfoward">Enable port forward: %1$s</string> + <string name="local_shell_unavailable">Failure! Local shell is unavailable on this phone.</string> <!-- Text sent to the user to alert them that a Terminal Bell is received in a background session --> diff --git a/src/org/connectbot/service/TerminalBridge.java b/src/org/connectbot/service/TerminalBridge.java index efb35b3..f66d89c 100644 --- a/src/org/connectbot/service/TerminalBridge.java +++ b/src/org/connectbot/service/TerminalBridge.java @@ -282,7 +282,7 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener { transport.addPortForward(portForward); } - outputLine(String.format("Connecting to %s:%d via %s", host.getHostname(), host.getPort(), host.getProtocol())); + outputLine(manager.res.getString(R.string.terminal_connecting, host.getHostname(), host.getPort(), host.getProtocol())); Thread connectionThread = new Thread(new Runnable() { public void run() { diff --git a/src/org/connectbot/transport/SSH.java b/src/org/connectbot/transport/SSH.java index 3e3af20..f34f791 100644 --- a/src/org/connectbot/transport/SSH.java +++ b/src/org/connectbot/transport/SSH.java @@ -155,13 +155,13 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC switch(hosts.verifyHostkey(matchName, serverHostKeyAlgorithm, serverHostKey)) { case KnownHosts.HOSTKEY_IS_OK: - bridge.outputLine(String.format("Verified host %s key: %s", algorithmName, fingerprint)); + bridge.outputLine(manager.res.getString(R.string.terminal_sucess, algorithmName, fingerprint)); return true; case KnownHosts.HOSTKEY_IS_NEW: // prompt user - bridge.outputLine(String.format(manager.res.getString(R.string.host_authenticity_warning), hostname)); - bridge.outputLine(String.format(manager.res.getString(R.string.host_fingerprint), algorithmName, fingerprint)); + bridge.outputLine(manager.res.getString(R.string.host_authenticity_warning, hostname)); + bridge.outputLine(manager.res.getString(R.string.host_fingerprint, algorithmName, fingerprint)); result = bridge.promptHelper.requestBooleanPrompt(null, manager.res.getString(R.string.prompt_continue_connecting)); if(result == null) return false; @@ -212,7 +212,7 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC Log.d(TAG, "Host does not support 'none' authentication."); } - bridge.outputLine("Trying to authenticate"); + bridge.outputLine(manager.res.getString(R.string.terminal_auth)); try { long pubkeyId = host.getPubkeyId(); @@ -240,7 +240,7 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC } } } else { - bridge.outputLine("Attempting 'publickey' authentication with a specific public key"); + bridge.outputLine(manager.res.getString(R.string.terminal_auth_pubkey_specific)); // use a specific key for this host, as requested PubkeyBean pubkey = manager.pubkeydb.findPubkeyById(pubkeyId); @@ -255,7 +255,7 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC } else if (connection.isAuthMethodAvailable(host.getUsername(), AUTH_PASSWORD)) { bridge.outputLine(manager.res.getString(R.string.terminal_auth_pass)); String password = bridge.getPromptHelper().requestStringPrompt(null, - manager.res.getString(R.string.terminal_auth_pass_hint)); + manager.res.getString(R.string.prompt_password)); if (password != null && connection.authenticateWithPassword(host.getUsername(), password)) { finishConnection(); @@ -353,7 +353,7 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC //bridge.outputLine(String.format("Attempting 'publickey' with key '%s' [%s]...", keyNickname, trileadKey.toString())); boolean success = connection.authenticateWithPublicKey(username, trileadKey); if(!success) - bridge.outputLine(String.format("Authentication method 'publickey' with key '%s' failed", keyNickname)); + bridge.outputLine(manager.res.getString(R.string.terminal_auth_pubkey_fail, keyNickname)); return success; } @@ -367,14 +367,14 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC for (PortForwardBean portForward : portForwards) { try { enablePortForward(portForward); - bridge.outputLine(String.format("Enable port forward: %s", portForward.getDescription())); + bridge.outputLine(manager.res.getString(R.string.terminal_enable_portfoward, portForward.getDescription())); } catch (Exception e) { Log.e(TAG, "Error setting up port forward during connect", e); } } if (!host.getWantSession()) { - bridge.outputLine("Session will not be started due to host preference."); + bridge.outputLine(manager.res.getString(R.string.terminal_no_session)); bridge.onConnected(); return; } @@ -431,17 +431,17 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC .equals(connectionInfo.serverToClientCryptoAlgorithm) && connectionInfo.clientToServerMACAlgorithm .equals(connectionInfo.serverToClientMACAlgorithm)) { - bridge.outputLine(String.format("Using algorithm: %s %s", + bridge.outputLine(manager.res.getString(R.string.terminal_using_algorithm, connectionInfo.clientToServerCryptoAlgorithm, connectionInfo.clientToServerMACAlgorithm)); } else { - bridge.outputLine(String.format( - "Client-to-server algorithm: %s %s", + bridge.outputLine(manager.res.getString( + R.string.terminal_using_c2s_algorithm, connectionInfo.clientToServerCryptoAlgorithm, connectionInfo.clientToServerMACAlgorithm)); - bridge.outputLine(String.format( - "Server-to-client algorithm: %s %s", + bridge.outputLine(manager.res.getString( + R.string.terminal_using_s2c_algorithm, connectionInfo.serverToClientCryptoAlgorithm, connectionInfo.serverToClientMACAlgorithm)); } |