sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject [2/3] git commit: SQOOP-648: Move all string message in client to resource file for easy translation
Date Sat, 08 Dec 2012 21:30:48 GMT
SQOOP-648: Move all string message in client to resource file for easy translation

(Venkat Ranganathan via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/a32d8d1c
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/a32d8d1c
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/a32d8d1c

Branch: refs/heads/sqoop2
Commit: a32d8d1c755c1005a3efd625377cdecfbd5440a8
Parents: 671d849
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sat Dec 8 13:30:11 2012 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sat Dec 8 13:30:11 2012 -0800

----------------------------------------------------------------------
 .../org/apache/sqoop/client/core/Constants.java    |  287 +++++++++++++++
 .../apache/sqoop/client/shell/CloneCommand.java    |   23 +-
 .../client/shell/CloneConnectionFunction.java      |   30 +-
 .../sqoop/client/shell/CloneJobFunction.java       |   27 +-
 .../apache/sqoop/client/shell/CreateCommand.java   |   22 +-
 .../client/shell/CreateConnectionFunction.java     |   28 +-
 .../sqoop/client/shell/CreateJobFunction.java      |   39 +-
 .../apache/sqoop/client/shell/DeleteCommand.java   |   20 +-
 .../client/shell/DeleteConnectionFunction.java     |   13 +-
 .../sqoop/client/shell/DeleteJobFunction.java      |   12 +-
 .../org/apache/sqoop/client/shell/HelpCommand.java |   43 ++-
 .../org/apache/sqoop/client/shell/SetCommand.java  |   22 +-
 .../sqoop/client/shell/SetOptionFunction.java      |   36 +-
 .../sqoop/client/shell/SetServerFunction.java      |   46 ++--
 .../org/apache/sqoop/client/shell/ShowCommand.java |   32 +-
 .../sqoop/client/shell/ShowConnectionFunction.java |   42 ++-
 .../sqoop/client/shell/ShowConnectorFunction.java  |   50 ++--
 .../sqoop/client/shell/ShowFrameworkFunction.java  |   13 +-
 .../apache/sqoop/client/shell/ShowJobFunction.java |   41 ++-
 .../sqoop/client/shell/ShowServerFunction.java     |   61 ++--
 .../sqoop/client/shell/ShowVersionFunction.java    |   87 +++---
 .../apache/sqoop/client/shell/SqoopCommand.java    |   14 +-
 .../apache/sqoop/client/shell/SqoopFunction.java   |    9 +
 .../org/apache/sqoop/client/shell/SqoopShell.java  |   25 +-
 .../sqoop/client/shell/SubmissionCommand.java      |   24 +-
 .../client/shell/SubmissionStartFunction.java      |   14 +-
 .../client/shell/SubmissionStatusFunction.java     |   14 +-
 .../sqoop/client/shell/SubmissionStopFunction.java |   16 +-
 .../apache/sqoop/client/shell/UpdateCommand.java   |   20 +-
 .../client/shell/UpdateConnectionFunction.java     |   26 +-
 .../sqoop/client/shell/UpdateJobFunction.java      |   25 +-
 .../src/main/resources/client-resource.properties  |  144 ++++++++
 32 files changed, 925 insertions(+), 380 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/core/Constants.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/core/Constants.java b/client/src/main/java/org/apache/sqoop/client/core/Constants.java
index 47c0547..72fe91c 100644
--- a/client/src/main/java/org/apache/sqoop/client/core/Constants.java
+++ b/client/src/main/java/org/apache/sqoop/client/core/Constants.java
@@ -22,8 +22,295 @@ package org.apache.sqoop.client.core;
  */
 public class Constants {
 
+  // General string constants
   public static final String RESOURCE_NAME = "client-resource";
+  public static final String BOLD_STR_SEQUENCE = "@|bold";
+  public static final String END_STR_SEQUENCE = "|@";
+  // Options
 
+  public static final String OPT_XID = "xid";
+  public static final String OPT_ALL = "all";
+  public static final String OPT_JID = "jid";
+  public static final String OPT_CID = "cid";
+  public static final String OPT_TYPE = "type";
+  public static final String OPT_NAME = "name";
+  public static final String OPT_VALUE = "value";
+  public static final String OPT_VERBOSE = "verbose";
+  public static final String OPT_HOST = "host";
+  public static final String OPT_PORT = "port";
+  public static final String OPT_WEBAPP = "webapp";
+  public static final String OPT_SERVER = "server";
+  public static final String OPT_CLIENT = "client";
+  public static final String OPT_PROTOCOL = "protocol";
+
+  public static final char OPT_XID_CHAR = 'x';
+  public static final char OPT_ALL_CHAR = 'a';
+  public static final char OPT_JID_CHAR = 'j';
+  public static final char OPT_CID_CHAR = 'c';
+  public static final char OPT_TYPE_CHAR = 't';
+  public static final char OPT_NAME_CHAR = 'n';
+  public static final char OPT_VALUE_CHAR = 'v';
+  public static final char OPT_HOST_CHAR = 'h';
+  public static final char OPT_PORT_CHAR = 'p';
+  public static final char OPT_WEBAPP_CHAR = 'w';
+  public static final char OPT_SERVER_CHAR = 's';
+  public static final char OPT_CLIENT_CHAR = 'c';
+  public static final char OPT_PROTOCOL_CHAR = 'p';
+
+
+
+  // Resource keys for various commands, command options,
+  // functions and descriptions
+  public static final String CMD_CLONE = "clone";
+  public static final String CMD_CLONE_SC = "\\cl";
+
+  public static final String CMD_CREATE = "create";
+  public static final String CMD_CREATE_SC = "\\cr";
+
+  public static final String CMD_DELETE = "delete";
+  public static final String CMD_DELETE_SC = "\\d";
+
+  public static final String CMD_HELP = "help";
+  public static final String CMD_HELP_SC = "\\h";
+
+  public static final String CMD_SET = "set";
+  public static final String CMD_SET_SC = "\\st";
+
+  public static final String CMD_SHOW = "show";
+  public static final String CMD_SHOW_SC = "\\sh";
+
+  public static final String CMD_SUBMISSION = "submit";
+  public static final String CMD_SUBMISSION_SC = "\\sub";
+
+  public static final String CMD_UPDATE = "update";
+  public static final String CMD_UPDATE_SC = "\\up";
+
+  public static final String FN_CONNECTION = "connection";
+  public static final String FN_JOB = "job";
+  public static final String FN_SERVER = "server";
+  public static final String FN_OPTION = "option";
+  public static final String FN_CONNECTOR = "connector";
+  public static final String FN_VERSION = "version";
+  public static final String FN_FRAMEWORK = "framework";
+  public static final String FN_START = "start";
+  public static final String FN_STOP = "stop";
+  public static final String FN_STATUS = "status";
+
+  public static final String PRE_CLONE = "Clone";
+  public static final String PRE_CREATE = "Create";
+  public static final String PRE_DELETE = "Delete";
+  public static final String PRE_SET = "Set";
+  public static final String PRE_SHOW = "Show";
+  public static final String PRE_SUBMISSION = "Submission";
+  public static final String PRE_UPDATE = "Update";
+  public static final String SUF_INFO = "Info";
+
+
+  public static final String PROP_HOMEDIR = "user.home";
+  public static final String PROP_CURDIR = "user.dir";
+  public static final String SQOOP_PROMPT = "sqoop";
+
+
+  // Resource Keys for various messages
+
+  public static final String RES_ARGS_XID_MISSING =
+      "args.xid_missing";
+  public static final String RES_ARGS_JID_MISSING =
+      "args.jid_missing";
+  public static final String RES_ARGS_CID_MISSING =
+      "args.cid_missing";
+  public static final String RES_ARGS_TYPE_MISSING =
+      "args.type_missing";
+  public static final String RES_ARGS_NAME_MISSING =
+      "args.name_missing";
+  public static final String RES_ARGS_VALUE_MISSING =
+      "args.value_missing";
+
+  public static final String RES_PROMPT_CONN_ID =
+      "prompt.conn_id";
+  public static final String RES_PROMPT_JOB_ID =
+      "prompt.job_id";
+  public static final String RES_CONNECTOR_ID =
+      "prompt.connector_id";
+  public static final String RES_PROMPT_JOB_TYPE =
+      "prompt.job_type";
+  public static final String RES_PROMPT_UPDATE_CONN_METADATA =
+      "prompt.update_conn_metadata";
+  public static final String RES_PROMPT_UPDATE_JOB_METADATA =
+      "prompt.update_job_metadata";
+  public static final String RES_PROMPT_FILL_CONN_METADATA =
+      "prompt.fill_conn_metadata";
+  public static final String RES_PROMPT_FILL_JOB_METADATA =
+      "prompt.fill_job_metadata";
+
+
+
+
+  public static final String RES_CLONE_USAGE =
+      "clone.usage";
+  public static final String RES_CLONE_CONN_SUCCESSFUL =
+      "clone.conn_successful";
+  public static final String RES_CLONE_JOB_SUCCESSFUL =
+      "clone.job.successful";
+  public static final String RES_CLONE_CLONING_CONN =
+      "clone.cloning_conn";
+  public static final String RES_CLONE_CLONING_JOB =
+      "clone.cloning_job";
+
+
+  public static final String RES_CREATE_USAGE =
+      "create.usage";
+  public static final String RES_CREATE_CONN_SUCCESSFUL =
+      "create.conn_successful";
+  public static final String RES_CREATE_JOB_SUCCESSFUL =
+      "create.job_successful";
+  public static final String RES_CREATE_CREATING_CONN =
+      "create.creating_conn";
+  public static final String RES_CREATE_CREATING_JOB =
+      "create.creating_job";
+
+
+  public static final String RES_DELETE_USAGE =
+      "delete.usage";
+
+  public static final String RES_HELP_USAGE =
+      "help.usage";
+  public static final String RES_HELP_DESCRIPTION =
+      "help.description";
+  public static final String RES_HELP_CMD_USAGE =
+      "help.cmd_usage";
+  public static final String RES_HELP_MESSAGE =
+      "help.message";
+  public static final String RES_HELP_INFO =
+      "help.info";
+  public static final String RES_HELP_AVAIL_COMMANDS =
+      "help.avail_commands";
+  public static final String RES_HELP_CMD_DESCRIPTION =
+      "help.cmd_description";
+  public static final String RES_HELP_SPECIFIC_CMD_INFO =
+      "help.specific_cmd_info";
+
+  public static final String RES_UNRECOGNIZED_CMD =
+      "unrecognized.cmd";
+
+  public static final String RES_SET_USAGE =
+      "set.usage";
+  public static final String RES_SET_PROMPT_OPT_NAME =
+      "set.prompt_opt_name";
+  public static final String RES_SET_PROMPT_OPT_VALUE =
+      "set.prompt_opt_value";
+  public static final String RES_SET_VERBOSE_CHANGED =
+      "set.verbose_changed";
+  public static final String RES_SET_UNKNOWN_OPT_IGNORED =
+      "set.unknown_opt_ignored";
+  public static final String RES_SET_HOST_DESCRIPTION =
+      "set.host_description";
+  public static final String RES_SET_PORT_DESCRIPTION =
+      "set.port_description";
+  public static final String RES_WEBAPP_DESCRIPTION =
+      "set.webapp_description";
+  public static final String RES_SET_SERVER_USAGE =
+      "set.server_usage";
+  public static final String RES_SET_SERVER_SUCCESSFUL =
+      "set.server_successful";
+
+  public static final String RES_SHOW_USAGE =
+      "show.usage";
+  public static final String RES_SHOW_PROMPT_DISPLAY_ALL_CONNS =
+      "show.prompt_display_all_conns";
+  public static final String RES_SHOW_PROMPT_DISPLAY_CONN_XID =
+      "show.prompt_display_conn_xid";
+  public static final String RES_SHOW_CONN_USAGE =
+      "show.conn_usage";
+  public static final String RES_SHOW_PROMPT_CONNS_TO_SHOW =
+      "show.prompt_conns_to_show";
+  public static final String RES_SHOW_PROMPT_CONN_INFO =
+      "show.prompt_conn_info";
+
+
+  public static final String RES_SHOW_PROMPT_DISPLAY_ALL_CONNECTORS =
+      "show.prompt_display_all_connectors";
+  public static final String RES_SHOW_PROMPT_DISPLAY_CONNECTOR_CID =
+      "show.prompt_display_connector_cid";
+  public static final String RES_SHOW_CONNECTOR_USAGE =
+      "show.connector_usage";
+  public static final String RES_SHOW_PROMPT_CONNECTORS_TO_SHOW =
+      "show.prompt_connectors_to_show";
+  public static final String RES_SHOW_PROMPT_CONNECTOR_INFO =
+      "show.prompt_connector_info";
+
+  public static final String RES_SHOW_FRAMEWORK_USAGE =
+      "show.framework_usage";
+  public static final String RES_SHOW_PROMPT_FRAMEWORK_OPTS =
+      "show.prompt_framework_opts";
+
+  public static final String RES_SHOW_PROMPT_DISPLAY_ALL_JOBS =
+      "show.prompt_display_all_jobs";
+  public static final String RES_SHOW_PROMPT_DISPLAY_JOB_JID =
+      "show.prompt_display_job_jid";
+  public static final String RES_SHOW_JOB_USAGE =
+      "show.job_usage";
+  public static final String RES_SHOW_PROMPT_JOBS_TO_SHOW =
+      "show.prompt_jobs_to_show";
+  public static final String RES_SHOW_PROMPT_JOB_INFO =
+      "show.prompt_job_info";
+
+  public static final String RES_SHOW_PROMPT_DISPLAY_ALL_SERVERS =
+      "show.prompt_display_all_servers";
+  public static final String RES_SHOW_PROMPT_DISPLAY_SERVER_HOST =
+      "show.prompt_display_server_host";
+  public static final String RES_SHOW_PROMPT_DISPLAY_SERVER_PORT =
+      "show.prompt_display_server_port";
+  public static final String RES_SHOW_PROMPT_DISPLAY_SERVER_WEBAPP =
+      "show.prompt_display_server_webapp";
+  public static final String RES_SHOW_SERVER_USAGE =
+      "show.server_usage";
+  public static final String RES_SHOW_PROMPT_SERVER_HOST =
+      "show.prompt_server_host";
+  public static final String RES_SHOW_PROMPT_SERVER_PORT =
+      "show.prompt_server_port";
+  public static final String RES_SHOW_PROMPT_SERVER_WEBAPP =
+      "show.prompt_server_webapp";
+
+  public static final String RES_SHOW_PROMPT_DISPLAY_ALL_VERSIONS =
+      "show.prompt_display_all_versions";
+  public static final String RES_SHOW_PROMPT_DISPLAY_VERSION_SERVER =
+      "show.prompt_display_version_server";
+  public static final String RES_SHOW_PROMPT_DISPLAY_VERSION_CLIENT =
+      "show.prompt_display_version_client";
+  public static final String RES_SHOW_PROMPT_DISPLAY_VERSION_PROTOCOL =
+      "show.prompt_display_version_protocol";
+  public static final String RES_SHOW_VERSION_USAGE =
+      "show.version_usage";
+  public static final String RES_SHOW_PROMPT_VERSION_CLIENT_SERVER =
+      "show.prompt_version_client_server";
+  public static final String RES_SHOW_PROMPT_VERSION_PROTOCOL =
+      "show.prompt_version_protocol";
+
+
+
+  public static final String RES_SQOOP_SHELL_BANNER =
+      "sqoop.shell_banner";
+  public static final String RES_SQOOP_PROMPT_SHELL_LOADRC =
+      "sqoop.prompt_shell_loadrc";
+  public static final String RES_SQOOP_PROMPT_SHELL_LOADEDRC =
+      "sqoop.prompt_shell_loadedrc";
+
+
+  public static final String RES_SUBMISSION_USAGE =
+      "submission.usage";
+
+
+  public static final String RES_UPDATE_USAGE =
+      "update.usage";
+  public static final String RES_UPDATE_UPDATING_CONN =
+      "update.updating_conn";
+  public static final String RES_UPDATE_CONN_SUCCESSFUL =
+      "update.conn_successful";
+  public static final String RES_UPDATE_UPDATING_JOB =
+      "update.updating_job";
+  public static final String RES_UPDATE_JOB_SUCCESSFUL =
+      "update.job_successful";
   private Constants() {
     // Instantiation is prohibited
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
index 847a6ad..827d168 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
@@ -18,10 +18,13 @@
 package org.apache.sqoop.client.shell;
 
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.Shell;
 
+import java.text.MessageFormat;
 import java.util.List;
+import java.util.ResourceBundle;
 
 /**
  * Client side cloning of connection and job objects.
@@ -31,33 +34,37 @@ public class CloneCommand extends SqoopCommand {
   private CloneConnectionFunction connectionFunction;
   private CloneJobFunction jobFunction;
 
+
+
   public CloneCommand(Shell shell) {
-    super(shell, "clone", "\\cl",
-      new String[] {"connection", "job"},
-      "Clone", "Info");
+    super(shell, Constants.CMD_CLONE, Constants.CMD_CLONE_SC,
+      new String[] {Constants.FN_CONNECTION, Constants.FN_JOB},
+      Constants.PRE_CLONE, Constants.SUF_INFO);
   }
 
   public Object execute(List args) {
+    String usageMsg = MessageFormat.format(getResource().getString(Constants
+        .RES_CLONE_USAGE), getUsage());
+
     if (args.size() == 0) {
-      io.out.println("Usage: clone " + getUsage());
+      io.out.println(usageMsg);
       io.out.println();
       return null;
     }
 
     String func = (String)args.get(0);
-    if (func.equals("connection")) {
+    if (func.equals(Constants.FN_CONNECTION)) {
       if (connectionFunction == null) {
         connectionFunction = new CloneConnectionFunction(io);
       }
       return connectionFunction.execute(args);
-    } else if (func.equals("job")) {
+    } else if (func.equals(Constants.FN_JOB)) {
       if (jobFunction == null) {
         jobFunction = new CloneJobFunction(io);
       }
       return jobFunction.execute(args);
     } else {
-      String msg = "Usage: clone " + getUsage();
-      throw new SqoopException(ClientError.CLIENT_0002, msg);
+      throw new SqoopException(ClientError.CLIENT_0002, usageMsg);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java
index 21c41aa..9d6c396 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java
@@ -21,6 +21,7 @@ import jline.ConsoleReader;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.json.ConnectionBean;
 import org.apache.sqoop.model.MConnection;
@@ -29,6 +30,7 @@ import org.apache.sqoop.validation.Status;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -40,31 +42,33 @@ import static org.apache.sqoop.client.core.RequestCache.*;
  */
 public class CloneConnectionFunction extends SqoopFunction {
 
-  private static final String XID = "xid";
+
 
   private IO io;
 
+
+
   @SuppressWarnings("static-access")
   public CloneConnectionFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-      .withDescription("Connection ID")
-      .withLongOpt(XID)
+      .withDescription(getResource().getString(Constants.RES_PROMPT_CONN_ID))
+      .withLongOpt(Constants.OPT_XID)
       .hasArg()
-      .create(XID.charAt(0))
+      .create(Constants.OPT_XID_CHAR)
     );
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(XID)) {
-      io.out.println("Required argument --xid is missing.");
+    if (!line.hasOption(Constants.OPT_XID)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_XID_MISSING));
       return null;
     }
 
     try {
-      cloneConnection(line.getOptionValue(XID));
+      cloneConnection(line.getOptionValue(Constants.OPT_XID));
     } catch (IOException ex) {
       throw new SqoopException(ClientError.CLIENT_0005, ex);
     }
@@ -73,7 +77,9 @@ public class CloneConnectionFunction extends SqoopFunction {
   }
 
   private void cloneConnection(String connectionId) throws IOException {
-    io.out.println("Cloning connection with id " + connectionId);
+
+    io.out.println(MessageFormat.format(getResource().getString(Constants
+        .RES_CLONE_CLONING_CONN), connectionId ));
 
     ConsoleReader reader = new ConsoleReader();
 
@@ -91,7 +97,8 @@ public class CloneConnectionFunction extends SqoopFunction {
 
     Status status = Status.FINE;
 
-    io.out.println("Please update connection metadata:");
+    io.out.println(getResource().getString(Constants
+       .RES_PROMPT_UPDATE_CONN_METADATA));
 
     do {
       // Print error introduction if needed
@@ -109,7 +116,8 @@ public class CloneConnectionFunction extends SqoopFunction {
 
     } while(!status.canProceed());
 
-    io.out.println("Connection was successfully created with validation status "
-      + status.name() + " and persistent id " + connection.getPersistenceId());
+    io.out.println(MessageFormat.format(getResource()
+        .getString(Constants.RES_CLONE_CONN_SUCCESSFUL),
+        status.name(), connection.getPersistenceId()));
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java
index b0e8d90..d06f051 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java
@@ -21,6 +21,7 @@ import jline.ConsoleReader;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.json.JobBean;
 import org.apache.sqoop.model.MJob;
@@ -29,6 +30,7 @@ import org.apache.sqoop.validation.Status;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -40,30 +42,30 @@ import static org.apache.sqoop.client.core.RequestCache.*;
  */
 public class CloneJobFunction extends SqoopFunction {
 
-  private static final String JID = "jid";
 
   private IO io;
 
+
   @SuppressWarnings("static-access")
   public CloneJobFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-      .withDescription("Job ID")
-      .withLongOpt(JID)
+      .withDescription(getResource().getString(Constants.RES_PROMPT_JOB_ID))
+      .withLongOpt(Constants.OPT_JID)
       .hasArg()
-      .create(JID.charAt(0)));
+      .create(Constants.OPT_JID_CHAR));
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(JID)) {
-      io.out.println("Required argument --jid is missing.");
+    if (!line.hasOption(Constants.OPT_JID)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_JID_MISSING));
       return null;
     }
 
     try {
-      cloneJob(line.getOptionValue(JID));
+      cloneJob(line.getOptionValue(Constants.OPT_JID));
     } catch (IOException ex) {
       throw new SqoopException(ClientError.CLIENT_0005, ex);
     }
@@ -72,7 +74,8 @@ public class CloneJobFunction extends SqoopFunction {
   }
 
   private void cloneJob(String jobId) throws IOException {
-    io.out.println("Cloning job with id " + jobId);
+    MessageFormat.format(getResource().getString(Constants.RES_CLONE_CLONING_JOB),
+        jobId);
 
     ConsoleReader reader = new ConsoleReader();
 
@@ -90,7 +93,8 @@ public class CloneJobFunction extends SqoopFunction {
     // Remove persistent id as we're making a clone
     job.setPersistenceId(MPersistableEntity.PERSISTANCE_ID_DEFAULT);
 
-    io.out.println("Please update job metadata:");
+    io.out.println(getResource().getString(Constants
+        .RES_PROMPT_UPDATE_JOB_METADATA));
 
     do {
       // Print error introduction if needed
@@ -107,8 +111,9 @@ public class CloneJobFunction extends SqoopFunction {
       status = createJobApplyValidations(job);
     } while(!status.canProceed());
 
-    io.out.println("Job was successfully created with validation status "
-      + status.name() + " and persistent id " + job.getPersistenceId());
+    io.out.println(MessageFormat.format(getResource()
+        .getString(Constants.RES_CLONE_JOB_SUCCESSFUL), status.name(),
+        job.getPersistenceId()));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
index 2453543..ad4d8fd 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
@@ -18,10 +18,13 @@
 package org.apache.sqoop.client.shell;
 
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.Shell;
 
+import java.text.MessageFormat;
 import java.util.List;
+import java.util.ResourceBundle;
 
 /**
  *
@@ -31,33 +34,36 @@ public class CreateCommand extends SqoopCommand {
   private CreateConnectionFunction connectionFunction;
   private CreateJobFunction jobFunction;
 
+
   public CreateCommand(Shell shell) {
-    super(shell, "create", "\\cr",
-      new String[] {"connection", "job"},
-      "Create", "info");
+    super(shell, Constants.CMD_CREATE, Constants.CMD_CREATE_SC,
+      new String[] {Constants.FN_CONNECTION, Constants.FN_JOB},
+      Constants.PRE_CREATE, Constants.SUF_INFO);
   }
 
   public Object execute(List args) {
+    String usageMsg = MessageFormat.format(getResource().getString(Constants
+        .RES_CREATE_USAGE), getUsage());
+
     if (args.size() == 0) {
-      io.out.println("Usage: create " + getUsage());
+      io.out.println(usageMsg);
       io.out.println();
       return null;
     }
 
     String func = (String)args.get(0);
-    if (func.equals("connection")) {
+    if (func.equals(Constants.FN_CONNECTION)) {
       if (connectionFunction == null) {
         connectionFunction = new CreateConnectionFunction(io);
       }
       return connectionFunction.execute(args);
-    } else if (func.equals("job")) {
+    } else if (func.equals(Constants.FN_JOB)) {
       if (jobFunction == null) {
         jobFunction = new CreateJobFunction(io);
       }
       return jobFunction.execute(args);
     } else {
-      String msg = "Usage: create " + getUsage();
-      throw new SqoopException(ClientError.CLIENT_0002, msg);
+      throw new SqoopException(ClientError.CLIENT_0002, usageMsg);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java
index 4df1c71..2c750d3 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java
@@ -21,6 +21,7 @@ import jline.ConsoleReader;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.json.ConnectorBean;
 import org.apache.sqoop.json.FrameworkBean;
@@ -31,6 +32,7 @@ import org.apache.sqoop.validation.Status;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -42,7 +44,6 @@ import static org.apache.sqoop.client.core.RequestCache.*;
  */
 public class CreateConnectionFunction extends SqoopFunction {
 
-  private static final String CID = "cid";
 
   private IO io;
 
@@ -51,21 +52,21 @@ public class CreateConnectionFunction extends SqoopFunction {
     this.io = io;
 
     this.addOption(OptionBuilder
-      .withDescription("Connector ID")
-      .withLongOpt(CID)
+      .withDescription(Constants.RES_CONNECTOR_ID)
+      .withLongOpt(Constants.OPT_CID)
       .hasArg()
-      .create(CID.charAt(0)));
+      .create(Constants.OPT_CID_CHAR));
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(CID)) {
-      io.out.println("Required argument --cid is missing.");
+    if (!line.hasOption(Constants.OPT_CID)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_CID_MISSING));
       return null;
     }
 
     try {
-      createConnection(line.getOptionValue(CID));
+      createConnection(line.getOptionValue(Constants.OPT_CID));
     } catch (IOException ex) {
       throw new SqoopException(ClientError.CLIENT_0005, ex);
     }
@@ -74,7 +75,8 @@ public class CreateConnectionFunction extends SqoopFunction {
   }
 
   private void createConnection(String connectorId) throws IOException {
-    io.out.println("Creating connection for connector with id " + connectorId);
+    io.out.println(MessageFormat.format(getResource().getString(Constants
+        .RES_CREATE_CREATING_CONN), connectorId));
 
     ConsoleReader reader = new ConsoleReader();
 
@@ -93,8 +95,7 @@ public class CreateConnectionFunction extends SqoopFunction {
 
     Status status = Status.FINE;
 
-    io.out.println("Please fill following values to create new connection"
-      + " object");
+    io.out.println(getResource().getString(Constants.RES_PROMPT_FILL_CONN_METADATA));
 
     do {
       // Print error introduction if needed
@@ -112,8 +113,9 @@ public class CreateConnectionFunction extends SqoopFunction {
       status = createConnectionApplyValidations(connection);
     } while(!status.canProceed());
 
-    io.out.println("New connection was successfully created with validation "
-      + "status " + status.name() + " and persistent id "
-      + connection.getPersistenceId());
+
+    io.out.println(MessageFormat.format(getResource()
+        .getString(Constants.RES_CREATE_CONN_SUCCESSFUL), status.name(),
+        connection.getPersistenceId()));
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
index 3aa6c4f..2b55adc 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
@@ -21,6 +21,7 @@ import jline.ConsoleReader;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.json.ConnectionBean;
 import org.apache.sqoop.json.ConnectorBean;
@@ -33,6 +34,7 @@ import org.apache.sqoop.validation.Status;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -44,8 +46,6 @@ import static org.apache.sqoop.client.core.RequestCache.*;
  */
 public class CreateJobFunction extends  SqoopFunction {
 
-  private static final String XID = "xid";
-  private static final String TYPE = "type";
 
   private IO io;
 
@@ -54,32 +54,33 @@ public class CreateJobFunction extends  SqoopFunction {
     this.io = io;
 
     this.addOption(OptionBuilder
-      .withDescription("Connection ID")
-      .withLongOpt(XID)
+      .withDescription(getResource().getString(Constants.RES_PROMPT_CONN_ID))
+      .withLongOpt(Constants.OPT_XID)
       .hasArg()
-      .create(XID.charAt(0))
+      .create(Constants.OPT_XID_CHAR)
     );
     this.addOption(OptionBuilder
-      .withDescription("Job type")
-      .withLongOpt(TYPE)
+      .withDescription(getResource().getString(Constants.RES_PROMPT_JOB_TYPE))
+      .withLongOpt(Constants.OPT_TYPE)
       .hasArg()
-      .create(TYPE.charAt(0))
+      .create(Constants.OPT_TYPE_CHAR)
     );
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(XID)) {
-      io.out.println("Required argument --xid is missing.");
+    if (!line.hasOption(Constants.OPT_XID)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_XID_MISSING));
       return null;
     }
-    if (!line.hasOption(TYPE)) {
-      io.out.println("Required argument --type is missing.");
+    if (!line.hasOption(Constants.OPT_TYPE)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_TYPE_MISSING));
       return null;
     }
 
     try {
-      createJob(line.getOptionValue(XID), line.getOptionValue(TYPE));
+      createJob(line.getOptionValue(Constants.OPT_XID),
+          line.getOptionValue(Constants.OPT_TYPE));
     } catch (IOException ex) {
       throw new SqoopException(ClientError.CLIENT_0005, ex);
     }
@@ -88,7 +89,8 @@ public class CreateJobFunction extends  SqoopFunction {
   }
 
   private void createJob(String connectionId, String type) throws IOException {
-    io.out.println("Creating job for connection with id " + connectionId);
+    io.out.println(MessageFormat.format(getResource().getString(Constants
+        .RES_CREATE_CREATING_JOB), connectionId));
 
     ConsoleReader reader = new ConsoleReader();
 
@@ -117,8 +119,7 @@ public class CreateJobFunction extends  SqoopFunction {
 
     Status status = Status.FINE;
 
-    io.out.println("Please fill following values to create new job"
-      + " object");
+    io.out.println(getResource().getString(Constants.RES_PROMPT_FILL_JOB_METADATA));
 
     do {
       // Print error introduction if needed
@@ -135,8 +136,8 @@ public class CreateJobFunction extends  SqoopFunction {
       status = createJobApplyValidations(job);
     } while(!status.canProceed());
 
-    io.out.println("New job was successfully created with validation "
-      + "status " + status.name() + " and persistent id "
-      + job.getPersistenceId());
+    io.out.println(MessageFormat.format(getResource()
+        .getString(Constants.RES_CREATE_JOB_SUCCESSFUL), status.name(),
+        job.getPersistenceId()));
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
index bb09bf3..5ab6495 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
@@ -18,10 +18,13 @@
 package org.apache.sqoop.client.shell;
 
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.Shell;
 
+import java.text.MessageFormat;
 import java.util.List;
+import java.util.ResourceBundle;
 
 /**
  *
@@ -32,34 +35,35 @@ public class DeleteCommand extends SqoopCommand {
   private DeleteJobFunction jobFunction;
 
   public DeleteCommand(Shell shell) {
-    super(shell, "delete", "\\d",
-      new String[] {"connection", "job"},
-      "Delete", "info");
+    super(shell, Constants.CMD_DELETE, Constants.CMD_DELETE_SC,
+      new String[] {Constants.FN_CONNECTION, Constants.FN_JOB},
+      Constants.PRE_DELETE, Constants.SUF_INFO);
   }
 
   @Override
   @SuppressWarnings("unchecked")
   public Object execute(List args) {
+    String usageMsg = MessageFormat.format(getResource().getString(Constants
+        .RES_DELETE_USAGE), getUsage());
     if (args.size() == 0) {
-      io.out.println("Usage: delete " + getUsage());
+      io.out.println(usageMsg);
       io.out.println();
       return null;
     }
 
     String func = (String)args.get(0);
-    if (func.equals("connection")) {
+    if (func.equals(Constants.FN_CONNECTION)) {
       if (connectionFunction == null) {
         connectionFunction = new DeleteConnectionFunction(io);
       }
       return connectionFunction.execute(args);
-    } else if (func.equals("job")) {
+    } else if (func.equals(Constants.FN_JOB)) {
       if (jobFunction == null) {
         jobFunction = new DeleteJobFunction(io);
       }
       return jobFunction.execute(args);
     } else {
-      String msg = "Usage: delete " + getUsage();
-      throw new SqoopException(ClientError.CLIENT_0002, msg);
+      throw new SqoopException(ClientError.CLIENT_0002, usageMsg);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java
index ee2a1cf..154acc7 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java
@@ -19,9 +19,11 @@ package org.apache.sqoop.client.shell;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.util.List;
+
 import static org.apache.sqoop.client.core.RequestCache.*;
 
 /**
@@ -31,27 +33,26 @@ public class DeleteConnectionFunction extends SqoopFunction {
 
   private IO io;
 
-  private static final String XID = "xid";
 
   @SuppressWarnings("static-access")
   public DeleteConnectionFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-      .withDescription("Connection ID")
-      .withLongOpt(XID)
+      .withDescription(getResource().getString(Constants.RES_PROMPT_CONN_ID))
+      .withLongOpt(Constants.OPT_XID)
       .hasArg()
       .create('x'));
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(XID)) {
-      io.out.println("Required argument --xid is missing.");
+    if (!line.hasOption(Constants.OPT_XID)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_XID_MISSING));
       return null;
     }
 
-    deleteConnection(line.getOptionValue(XID));
+    deleteConnection(line.getOptionValue(Constants.OPT_XID));
 
     return null;
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java
index acc8e21..9d6c53e 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java
@@ -19,6 +19,7 @@ package org.apache.sqoop.client.shell;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.client.request.JobRequest;
 import org.codehaus.groovy.tools.shell.IO;
 
@@ -35,23 +36,22 @@ public class DeleteJobFunction extends SqoopFunction {
 
   private JobRequest jobRequest;
 
-  private static final String JID = "jid";
 
   @SuppressWarnings("static-access")
   public DeleteJobFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-      .withDescription("Job ID")
-      .withLongOpt(JID)
+      .withDescription(getResource().getString(Constants.RES_PROMPT_JOB_ID))
+      .withLongOpt(Constants.OPT_JID)
       .hasArg()
       .create('j'));
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(JID)) {
-      io.out.println("Required argument --jid is missing.");
+    if (!line.hasOption(Constants.OPT_JID)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_JID_MISSING));
       return null;
     }
 
@@ -59,7 +59,7 @@ public class DeleteJobFunction extends SqoopFunction {
       jobRequest = new JobRequest();
     }
 
-    deleteJob(line.getOptionValue(JID));
+    deleteJob(line.getOptionValue(Constants.OPT_JID));
 
     return null;
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java
index 03499d8..e14f738 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java
@@ -17,12 +17,15 @@
  */
 package org.apache.sqoop.client.shell;
 
+import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.ResourceBundle;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.Command;
 import org.codehaus.groovy.tools.shell.CommandSupport;
@@ -31,24 +34,26 @@ import org.codehaus.groovy.tools.shell.util.SimpleCompletor;
 
 public class HelpCommand extends CommandSupport
 {
+  private static final ResourceBundle clientResource =
+      ResourceBundle.getBundle(Constants.RESOURCE_NAME);
+
   protected HelpCommand(Shell shell) {
-    super(shell, "help", "\\h");
+    super(shell, Constants.CMD_HELP, Constants.CMD_HELP_SC);
   }
 
   @Override
   public String getDescription() {
-    return "Display this help message";
+    return clientResource.getString(Constants.RES_HELP_DESCRIPTION);
   }
 
   @Override
   public String getUsage() {
-    return "[<command>]";
+    return clientResource.getString(Constants.RES_HELP_USAGE);
   }
 
   @Override
   public String getHelp() {
-    return "Display the list of commands or "
-        + "the help text for @|bold command|@.";
+    return clientResource.getString(Constants.RES_HELP_MESSAGE);
   }
 
   @SuppressWarnings("rawtypes")
@@ -86,12 +91,12 @@ public class HelpCommand extends CommandSupport
       }
     }
     
-    io.out.println("For information about @|green Sqoop|@, visit:");
-    io.out.println("  @|cyan http://incubator.apache.org/sqoop/|@ ");
+    io.out.println(clientResource.getString(Constants.RES_HELP_INFO));
     io.out.println();
 
     // List the commands we know about
-    io.out.println("Available commands:");
+    io.out.println(clientResource.getString(Constants.RES_HELP_AVAIL_COMMANDS));
+
     iterator = shell.getRegistry().commands().iterator();
     while (iterator.hasNext()) {
       Command command = iterator.next();
@@ -105,26 +110,30 @@ public class HelpCommand extends CommandSupport
           StringUtils.rightPad(command.getShortcut(), maxShortcut);
         
       String description = command.getDescription();
-        
-      io.out.println("  @|bold " + paddedName + "|@  (@|bold "
-          + paddedShortcut + "|@) " + description);
+
+      StringBuilder sb = new StringBuilder();
+      sb.append("  ")
+         .append(MessageFormat.format(clientResource.getString(Constants
+             .RES_HELP_CMD_DESCRIPTION), paddedName,
+             paddedShortcut, description));
+      io.out.println(sb);
     }
     
     io.out.println();
-    io.out.println("For help on a specific command type:");
-    io.out.println("  help @|bold command|@ ");
+    io.out.println(clientResource.getString(Constants.RES_HELP_SPECIFIC_CMD_INFO));
     io.out.println();
   }
 
   private void help(String name) {
     Command command = shell.getRegistry().find(name);
     if (command == null) {
-      String msg = "Unrecognized command " + name;
+      String msg = MessageFormat.format(clientResource.getString(Constants
+          .RES_UNRECOGNIZED_CMD), name);
       throw new SqoopException(ClientError.CLIENT_0001, msg);
     }
-    
-    io.out.println("Usage: @|bold " + command.getName() + "|@ "
-        + command.getUsage());
+    io.out.println(MessageFormat.format(clientResource.getString
+        (Constants.RES_HELP_CMD_USAGE), command.getName(),
+        command.getUsage()));
     io.out.println();
     io.out.println(command.getHelp());
     io.out.println();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
index 20c8090..fb6e8c8 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
@@ -17,9 +17,12 @@
  */
 package org.apache.sqoop.client.shell;
 
+import java.text.MessageFormat;
 import java.util.List;
+import java.util.ResourceBundle;
 
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.Shell;
 
@@ -28,37 +31,40 @@ public class SetCommand extends SqoopCommand
   private SetServerFunction serverFunction;
   private SetOptionFunction optionFunction;
 
+
   protected SetCommand(Shell shell) {
-    super(shell, "set", "\\st",
-        new String[] {"server", "option"},
-        "Set", "info");
+    super(shell, Constants.CMD_SET, Constants.CMD_SET_SC,
+        new String[] {Constants.FN_SERVER, Constants.FN_OPTION},
+        Constants.PRE_SET, Constants.SUF_INFO);
   }
 
   @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
   public Object execute(List args) {
+    String usageMsg =  MessageFormat.format(getResource().getString(Constants
+        .RES_SET_USAGE), getUsage());
+
     if (args.size() == 0) {
-      io.out.println("Usage: set " + getUsage());
+      io.out.println(usageMsg);
       io.out.println();
       return null;
     }
     resolveVariables(args);
     String func = (String)args.get(0);
-    if (func.equals("server")) {
+    if (func.equals(Constants.FN_SERVER)) {
       if (serverFunction == null) {
         serverFunction = new SetServerFunction(io);
       }
       return serverFunction.execute(args);
 
-    } else if (func.equals("option")) {
+    } else if (func.equals(Constants.FN_OPTION)) {
       if (optionFunction == null) {
         optionFunction = new SetOptionFunction(io);
       }
       return optionFunction.execute(args);
 
     } else {
-      String msg = "Usage: set " + getUsage();
-      throw new SqoopException(ClientError.CLIENT_0002, msg);
+      throw new SqoopException(ClientError.CLIENT_0002, usageMsg);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java
index 3764306..5d5e9e7 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java
@@ -19,9 +19,11 @@ package org.apache.sqoop.client.shell;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.client.core.Environment;
 import org.codehaus.groovy.tools.shell.IO;
 
+import java.text.MessageFormat;
 import java.util.List;
 
 /**
@@ -29,44 +31,44 @@ import java.util.List;
  */
 public class SetOptionFunction extends SqoopFunction {
 
-  public static final String NAME = "name";
-  public static final String VALUE = "value";
 
   private IO io;
 
+
   @SuppressWarnings("static-access")
   protected SetOptionFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder.hasArg()
-      .withDescription("Client option name")
-      .withLongOpt(NAME)
-      .create(NAME.charAt(0)));
+      .withDescription(getResource().getString(Constants.RES_SET_PROMPT_OPT_NAME))
+      .withLongOpt(Constants.OPT_NAME)
+      .create(Constants.OPT_NAME_CHAR));
     this.addOption(OptionBuilder.hasArg()
-      .withDescription("New option value")
-      .withLongOpt(VALUE)
-      .create(VALUE.charAt(0)));
+      .withDescription(getResource().getString(Constants.RES_SET_PROMPT_OPT_VALUE))
+      .withLongOpt(Constants.OPT_VALUE)
+      .create(Constants.OPT_VALUE_CHAR));
   }
 
   public Object execute(List<String> args) {
     CommandLine line = parseOptions(this, 1, args);
-    if (!line.hasOption(NAME)) {
-      io.out.println("Required argument --name is missing.");
+    if (!line.hasOption(Constants.OPT_NAME)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_NAME_MISSING));
       return null;
     }
-    if (!line.hasOption(VALUE)) {
-      io.out.println("Required argument --value is missing.");
+    if (!line.hasOption(Constants.OPT_VALUE)) {
+      io.out.println(getResource().getString(Constants.RES_ARGS_VALUE_MISSING));
       return null;
     }
 
-    handleOptionSetting(line.getOptionValue(NAME), line.getOptionValue(VALUE));
+    handleOptionSetting(line.getOptionValue(Constants.OPT_NAME),
+        line.getOptionValue(Constants.OPT_VALUE));
 
     io.out.println();
     return null;
   }
 
   private void handleOptionSetting(String name, String value) {
-    if(name.equals("verbose")) {
+    if(name.equals(Constants.OPT_VERBOSE)) {
       boolean newValue = false;
 
       if(value.equals("1") || value.equals("true")) {
@@ -74,10 +76,12 @@ public class SetOptionFunction extends SqoopFunction {
       }
 
       Environment.setVerbose(newValue);
-      io.out.println("Verbose option was changed to " + newValue);
+      io.out.println(MessageFormat.format(getResource().getString(Constants
+          .RES_SET_VERBOSE_CHANGED), newValue));
       return;
     }
 
-    io.out.println("Unknown option " + name + ". Ignoring...");
+    io.out.println(MessageFormat.format(getResource().getString(Constants
+        .RES_SET_UNKNOWN_OPT_IGNORED), name));
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java
index daf1ff4..0e1e027 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java
@@ -22,38 +22,38 @@ import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.client.core.Environment;
 import org.codehaus.groovy.tools.shell.IO;
 
 @SuppressWarnings("serial")
 public class SetServerFunction extends SqoopFunction
 {
-  public static final String HOST = "host";
-  public static final String PORT = "port";
-  public static final String WEBAPP = "webapp";
+
 
   private IO io;
 
+
   @SuppressWarnings("static-access")
   protected SetServerFunction(IO io) {
     this.io = io;
 
-    this.addOption(OptionBuilder.hasArg().withArgName("host")
-        .withDescription(  "Host name to invoke server resources" )
-        .withLongOpt(HOST)
-        .create(HOST.charAt(0)));
-    this.addOption(OptionBuilder.hasArg().withArgName("port")
-        .withDescription(  "Port number to invoke server resources" )
-        .withLongOpt(PORT)
-        .create(PORT.charAt(0)));
-    this.addOption(OptionBuilder.hasArg().withArgName("webbapp")
-        .withDescription(  "Web app to invoke server resources" )
-        .withLongOpt(WEBAPP)
-        .create(WEBAPP.charAt(0)));
+    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_HOST)
+        .withDescription(getResource().getString(Constants.RES_SET_HOST_DESCRIPTION))
+        .withLongOpt(Constants.OPT_HOST)
+        .create(Constants.OPT_HOST_CHAR));
+    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_PORT)
+        .withDescription(getResource().getString(Constants.RES_SET_PORT_DESCRIPTION))
+        .withLongOpt(Constants.OPT_PORT)
+        .create(Constants.OPT_PORT_CHAR));
+    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_WEBAPP)
+        .withDescription(getResource().getString(Constants.RES_WEBAPP_DESCRIPTION))
+        .withLongOpt(Constants.OPT_WEBAPP)
+        .create(Constants.OPT_WEBAPP_CHAR));
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: set server");
+    out.println(getResource().getString(Constants.RES_SET_SERVER_USAGE));
     super.printHelp(out);
   }
 
@@ -65,17 +65,17 @@ public class SetServerFunction extends SqoopFunction
     }
 
     CommandLine line = parseOptions(this, 1, args);
-    if (line.hasOption(HOST)) {
-      Environment.setServerHost(line.getOptionValue(HOST));
+    if (line.hasOption(Constants.OPT_HOST)) {
+      Environment.setServerHost(line.getOptionValue(Constants.OPT_HOST));
     }
-    if (line.hasOption(PORT)) {
-      Environment.setServerPort(line.getOptionValue(PORT));
+    if (line.hasOption(Constants.OPT_PORT)) {
+      Environment.setServerPort(line.getOptionValue(Constants.OPT_PORT));
     }
-    if (line.hasOption(WEBAPP)) {
-      Environment.setServerWebapp(line.getOptionValue(WEBAPP));
+    if (line.hasOption(Constants.OPT_WEBAPP)) {
+      Environment.setServerWebapp(line.getOptionValue(Constants.OPT_WEBAPP));
     }
 
-    io.out.println("Server is set successfully.");
+    io.out.println(getResource().getString(Constants.RES_SET_SERVER_SUCCESSFUL));
     io.out.println();
     return null;
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
index bd74253..359add9 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
@@ -17,9 +17,12 @@
  */
 package org.apache.sqoop.client.shell;
 
+import java.text.MessageFormat;
 import java.util.List;
+import java.util.ResourceBundle;
 
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.Shell;
 
@@ -32,61 +35,64 @@ public class ShowCommand extends SqoopCommand
   private ShowFrameworkFunction frameworkFunction;
   private ShowConnectionFunction connectionFunction;
 
+
   protected ShowCommand(Shell shell) {
-    super(shell, "show", "\\sh",
-        new String[] {"server", "version", "connector", "framework",
-          "connection", "job"},
-        "Show", "info");
+    super(shell, Constants.CMD_SHOW, Constants.CMD_SHOW_SC,
+        new String[] {Constants.FN_SERVER, Constants.FN_VERSION,
+          Constants.FN_CONNECTOR, Constants.FN_FRAMEWORK,
+          Constants.FN_CONNECTION, Constants.FN_JOB },
+          Constants.PRE_SHOW, Constants.SUF_INFO);
   }
 
   @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
   public Object execute(List args) {
+    String usageMsg = MessageFormat.format(getResource().getString(Constants
+        .RES_SHOW_USAGE), getUsage());
     if (args.size() == 0) {
-      shell.getIo().out.println("Usage: show " + getUsage());
+      shell.getIo().out.println(usageMsg);
       io.out.println();
       return null;
     }
 
     String func = (String)args.get(0);
-    if (func.equals("server")) {
+    if (func.equals(Constants.FN_SERVER)) {
       if (serverFunction == null) {
         serverFunction = new ShowServerFunction(io);
       }
       return serverFunction.execute(args);
 
-    } else if (func.equals("version")) {
+    } else if (func.equals(Constants.FN_VERSION)) {
       if (versionFunction == null) {
         versionFunction = new ShowVersionFunction(io);
       }
       return versionFunction.execute(args);
 
-    } else if (func.equals("connector")) {
+    } else if (func.equals(Constants.FN_CONNECTOR)) {
       if (connectorFunction == null) {
         connectorFunction = new ShowConnectorFunction(io);
       }
       return connectorFunction.execute(args);
 
-    } else if (func.equals("framework")) {
+    } else if (func.equals(Constants.FN_FRAMEWORK)) {
       if (frameworkFunction == null) {
         frameworkFunction = new ShowFrameworkFunction(io);
       }
       return frameworkFunction.execute(args);
 
-    } else if (func.equals("connection")) {
+    } else if (func.equals(Constants.FN_CONNECTION)) {
       if (connectionFunction == null) {
         connectionFunction = new ShowConnectionFunction(io);
       }
       return connectionFunction.execute(args);
 
-    } else if (func.equals("job")) {
+    } else if (func.equals(Constants.FN_JOB)) {
       if (jobFunction == null) {
         jobFunction = new ShowJobFunction(io);
       }
       return jobFunction.execute(args);
     } else {
-      String msg = "Usage: show " + getUsage();
-      throw new SqoopException(ClientError.CLIENT_0002, msg);
+      throw new SqoopException(ClientError.CLIENT_0002, usageMsg);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
index 4e49288..17cb84a 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
@@ -19,11 +19,13 @@ package org.apache.sqoop.client.shell;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.json.ConnectionBean;
 import org.apache.sqoop.model.MConnection;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.PrintWriter;
+import java.text.MessageFormat;
 import java.util.List;
 
 import static org.apache.sqoop.client.utils.FormDisplayer.*;
@@ -33,27 +35,29 @@ import static org.apache.sqoop.client.core.RequestCache.*;
  *
  */
 public class ShowConnectionFunction extends SqoopFunction {
-  public static final String ALL = "all";
-  public static final String XID = "xid";
+
 
   private IO io;
 
+
   @SuppressWarnings("static-access")
   protected ShowConnectionFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-        .withDescription("Display all connections")
-        .withLongOpt(ALL)
-        .create(ALL.charAt(0)));
-    this.addOption(OptionBuilder.hasArg().withArgName("xid")
-        .withDescription(  "Display the connection with xid" )
-        .withLongOpt(XID)
-        .create('x'));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_ALL_CONNS))
+        .withLongOpt(Constants.OPT_ALL)
+        .create(Constants.OPT_ALL_CHAR));
+    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_XID)
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_CONN_XID))
+        .withLongOpt(Constants.OPT_XID)
+        .create(Constants.OPT_XID_CHAR));
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: show connection");
+    out.println(getResource().getString(Constants.RES_SHOW_CONN_USAGE));
     super.printHelp(out);
   }
 
@@ -65,11 +69,11 @@ public class ShowConnectionFunction extends SqoopFunction {
     }
 
     CommandLine line = parseOptions(this, 1, args);
-    if (line.hasOption(ALL)) {
+    if (line.hasOption(Constants.OPT_ALL)) {
       showConnection(null);
 
-    } else if (line.hasOption(XID)) {
-      showConnection(line.getOptionValue(XID));
+    } else if (line.hasOption(Constants.OPT_XID)) {
+      showConnection(line.getOptionValue(Constants.OPT_XID));
     }
 
     return null;
@@ -80,12 +84,16 @@ public class ShowConnectionFunction extends SqoopFunction {
 
     List<MConnection> connections = connectionBean.getConnections();
 
-    io.out.println("@|bold " + connections.size()
-      + " connection(s) to show: |@");
+    String s = MessageFormat.format(getResource().getString(Constants
+        .RES_SHOW_PROMPT_CONNS_TO_SHOW), connections.size());
+
+    io.out.println(s);
 
     for (MConnection connection : connections) {
-      io.out.println("Connection with id " + connection.getPersistenceId()
-        + " and name: " + connection.getName());
+      s =  MessageFormat.format(getResource().getString
+          (Constants.RES_SHOW_PROMPT_CONN_INFO), connection.getPersistenceId(),
+          connection.getName());
+      io.out.println(s);
 
       long connectorId = connection.getConnectorId();
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
index 3116cd9..6276b3e 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
@@ -18,12 +18,15 @@
 package org.apache.sqoop.client.shell;
 
 import java.io.PrintWriter;
+import java.text.MessageFormat;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.json.ConnectorBean;
 import org.apache.sqoop.model.MConnector;
 import org.codehaus.groovy.tools.shell.IO;
@@ -34,27 +37,28 @@ import static org.apache.sqoop.client.core.RequestCache.*;
 @SuppressWarnings("serial")
 public class ShowConnectorFunction extends SqoopFunction
 {
-  public static final String ALL = "all";
-  public static final String CID = "cid";
 
   private IO io;
 
+
   @SuppressWarnings("static-access")
   protected ShowConnectorFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-        .withDescription("Display all connectors")
-        .withLongOpt(ALL)
-        .create(ALL.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_ALL_CONNECTORS))
+        .withLongOpt(Constants.OPT_ALL)
+        .create(Constants.OPT_ALL_CHAR));
     this.addOption(OptionBuilder.hasArg().withArgName("cid")
-        .withDescription(  "Display the connector with cid" )
-        .withLongOpt(CID)
-        .create(CID.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_CONNECTOR_CID))
+        .withLongOpt(Constants.OPT_CID)
+        .create(Constants.OPT_CID_CHAR));
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: show connector");
+    out.println(getResource().getString(Constants.RES_SHOW_CONNECTOR_USAGE));
     super.printHelp(out);
   }
 
@@ -66,11 +70,11 @@ public class ShowConnectorFunction extends SqoopFunction
     }
 
     CommandLine line = parseOptions(this, 1, args);
-    if (line.hasOption(ALL)) {
+    if (line.hasOption(Constants.OPT_ALL)) {
       showConnector(null);
 
-    } else if (line.hasOption(CID)) {
-      showConnector(line.getOptionValue(CID));
+    } else if (line.hasOption(Constants.OPT_CID)) {
+      showConnector(line.getOptionValue(Constants.OPT_CID));
     }
 
     return null;
@@ -80,22 +84,16 @@ public class ShowConnectorFunction extends SqoopFunction
     ConnectorBean connectorBean = readConnector(cid);
     List<MConnector> connectors = connectorBean.getConnectors();
     Map<Long, ResourceBundle> bundles = connectorBean.getResourceBundles();
-
-    io.out.println("@|bold " + connectors.size() + " connector(s) to show: |@");
+    String s = MessageFormat.format(getResource().getString(Constants
+       .RES_SHOW_PROMPT_CONNECTORS_TO_SHOW), connectors.size());
+    io.out.println(s);
     for (MConnector connector : connectors) {
-      io.out.print("Connector with id ");
-      io.out.print(connector.getPersistenceId());
-      io.out.println(":");
-
-      io.out.print("  Name: ");
-      io.out.println(connector.getUniqueName());
-      io.out.print("  Class: ");
-      io.out.println(connector.getClassName());
-      io.out.print("  Version: ");
-      io.out.println(connector.getVersion());
-
+      s =  MessageFormat.format(getResource().getString(Constants
+        .RES_SHOW_PROMPT_CONNECTOR_INFO), connector.getPersistenceId(),
+        connector.getUniqueName(), connector.getClassName(),
+        connector.getVersion());
+      io.out.println(StringEscapeUtils.unescapeJava(s));
       displayFormMetadataDetails(io, connector, bundles.get(connector.getPersistenceId()));
-
     }
 
     io.out.println();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java
index 8dcf976..4bf1fa5 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java
@@ -17,11 +17,14 @@
  */
 package org.apache.sqoop.client.shell;
 
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.json.FrameworkBean;
 import org.apache.sqoop.model.MFramework;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.PrintWriter;
+import java.text.MessageFormat;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -41,7 +44,7 @@ public class ShowFrameworkFunction extends SqoopFunction {
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: show framework");
+    out.println(getResource().getString(Constants.RES_SHOW_FRAMEWORK_USAGE));
     super.printHelp(out);
   }
 
@@ -62,11 +65,9 @@ public class ShowFrameworkFunction extends SqoopFunction {
 
     MFramework framework = frameworkBean.getFramework();
     ResourceBundle bundle = frameworkBean.getResourceBundle();
-
-    io.out.println("@|bold Framework specific options: |@");
-
-    io.out.print("Persistent id: ");
-    io.out.println(framework.getPersistenceId());
+    io.out.println(StringEscapeUtils.unescapeJava(
+        MessageFormat.format(Constants.RES_SHOW_PROMPT_FRAMEWORK_OPTS,
+            framework.getPersistenceId())));
 
     displayFormMetadataDetails(io, framework, bundle);
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
index ee8c63d..259739a 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
@@ -19,11 +19,13 @@ package org.apache.sqoop.client.shell;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.json.JobBean;
 import org.apache.sqoop.model.MJob;
 import org.codehaus.groovy.tools.shell.IO;
 
 import java.io.PrintWriter;
+import java.text.MessageFormat;
 import java.util.List;
 
 import static org.apache.sqoop.client.utils.FormDisplayer.*;
@@ -34,9 +36,6 @@ import static org.apache.sqoop.client.core.RequestCache.*;
  */
 public class ShowJobFunction extends SqoopFunction {
 
-  public static final String ALL = "all";
-  public static final String JID = "jid";
-
   private IO io;
 
   @SuppressWarnings("static-access")
@@ -44,17 +43,19 @@ public class ShowJobFunction extends SqoopFunction {
     this.io = io;
 
     this.addOption(OptionBuilder
-        .withDescription("Display all jobs")
-        .withLongOpt(ALL)
-        .create(ALL.charAt(0)));
-    this.addOption(OptionBuilder.hasArg().withArgName("jid")
-        .withDescription("Display job with given jid" )
-        .withLongOpt(JID)
-        .create('j'));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_ALL_JOBS))
+        .withLongOpt(Constants.OPT_ALL)
+        .create(Constants.OPT_ALL_CHAR));
+    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_JID)
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_JOB_JID))
+        .withLongOpt(Constants.OPT_JID)
+        .create(Constants.OPT_JID_CHAR));
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: show job");
+    out.println(getResource().getString(Constants.RES_SHOW_JOB_USAGE));
     super.printHelp(out);
   }
 
@@ -66,11 +67,11 @@ public class ShowJobFunction extends SqoopFunction {
     }
 
     CommandLine line = parseOptions(this, 1, args);
-    if (line.hasOption(ALL)) {
+    if (line.hasOption(Constants.OPT_ALL)) {
       showJob(null);
 
-    } else if (line.hasOption(JID)) {
-      showJob(line.getOptionValue(JID));
+    } else if (line.hasOption(Constants.OPT_JID)) {
+      showJob(line.getOptionValue(Constants.OPT_JID));
     }
 
     return null;
@@ -80,13 +81,15 @@ public class ShowJobFunction extends SqoopFunction {
     JobBean jobBean = readJob(jid);
 
     List<MJob> jobs = jobBean.getJobs();
-
-    io.out.println("@|bold " + jobs.size()
-      + " job(s) to show: |@");
+    String s = MessageFormat.format(Constants
+        .RES_SHOW_PROMPT_JOBS_TO_SHOW, jobs.size());
+    io.out.println(s);
 
     for (MJob job : jobs) {
-      io.out.println("Job with id " + job.getPersistenceId()
-        + " and name: " + job.getName());
+      s = MessageFormat.format(getResource().getString
+          (Constants.RES_SHOW_PROMPT_JOB_INFO), job.getPersistenceId(),
+          job.getName());
+      io.out.println(s);
 
       long connectorId = job.getConnectorId();
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java
index 039e28b..e1f6fa6 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java
@@ -18,47 +18,50 @@
 package org.apache.sqoop.client.shell;
 
 import java.io.PrintWriter;
+import java.text.MessageFormat;
 import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.client.core.Environment;
 import org.codehaus.groovy.tools.shell.IO;
 
 @SuppressWarnings("serial")
 public class ShowServerFunction extends SqoopFunction
 {
-  public static final String ALL = "all";
-  public static final String HOST = "host";
-  public static final String PORT = "port";
-  public static final String WEBAPP = "webapp";
 
   private IO io;
 
+
   @SuppressWarnings("static-access")
   protected ShowServerFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-        .withDescription("Display all information")
-        .withLongOpt(ALL)
-        .create(ALL.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_ALL_SERVERS))
+        .withLongOpt(Constants.OPT_ALL)
+        .create(Constants.OPT_ALL_CHAR));
     this.addOption(OptionBuilder
-        .withDescription("Display server host name")
-        .withLongOpt(HOST)
-        .create(HOST.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_SERVER_HOST))
+        .withLongOpt(Constants.OPT_HOST)
+        .create(Constants.OPT_HOST_CHAR));
     this.addOption(OptionBuilder
-        .withDescription("Display server port number")
-        .withLongOpt(PORT)
-        .create(PORT.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_SERVER_PORT))
+        .withLongOpt(Constants.OPT_PORT)
+        .create(Constants.OPT_PORT_CHAR));
     this.addOption(OptionBuilder
-        .withDescription("Display server web app name")
-        .withLongOpt(WEBAPP)
-        .create(WEBAPP.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_SERVER_WEBAPP))
+        .withLongOpt(Constants.OPT_WEBAPP)
+        .create(Constants.OPT_WEBAPP_CHAR));
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: show server");
+    out.println(getResource().getString(Constants.RES_SHOW_SERVER_USAGE));
     super.printHelp(out);
   }
 
@@ -70,18 +73,18 @@ public class ShowServerFunction extends SqoopFunction
     }
 
     CommandLine line = parseOptions(this, 1, args);
-    if (line.hasOption(ALL)) {
+    if (line.hasOption(Constants.OPT_ALL)) {
       showServer(true, true, true, true);
 
     } else {
       boolean host = false, port = false, webapp = false, version = false;
-      if (line.hasOption(HOST)) {
+      if (line.hasOption(Constants.OPT_HOST)) {
         host = true;
       }
-      if (line.hasOption(PORT)) {
+      if (line.hasOption(Constants.OPT_PORT)) {
         port = true;
       }
-      if (line.hasOption(WEBAPP)) {
+      if (line.hasOption(Constants.OPT_WEBAPP)) {
         webapp = true;
       }
 
@@ -93,19 +96,23 @@ public class ShowServerFunction extends SqoopFunction
 
   private void showServer(boolean host, boolean port, boolean webapp,
       boolean version) {
+    String s;
     if (host) {
-      io.out.print("@|bold Server host:|@");
-      io.out.println(Environment.getServerHost());
+      s =  MessageFormat.format(getResource().getString(Constants
+          .RES_SHOW_PROMPT_SERVER_HOST), Environment.getServerHost());
+      io.out.println(s);
     }
 
     if (port) {
-      io.out.print("@|bold Server port:|@");
-      io.out.println(Environment.getServerPort());
+      s = MessageFormat.format(getResource().getString(Constants
+          .RES_SHOW_PROMPT_SERVER_PORT), Environment.getServerPort());
+      io.out.println(s);
     }
 
     if (webapp) {
-      io.out.print("@|bold Server webapp:|@");
-      io.out.println(Environment.getServerWebapp());
+      s = MessageFormat.format(getResource().getString(Constants
+          .RES_SHOW_PROMPT_SERVER_WEBAPP), Environment.getServerWebapp());
+      io.out.println(s);
     }
 
     io.out.println();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java
index 9e8c607..a0f3691 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java
@@ -18,52 +18,56 @@
 package org.apache.sqoop.client.shell;
 
 import java.io.PrintWriter;
+import java.text.MessageFormat;
 import java.util.Arrays;
 import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.client.core.Environment;
 import org.apache.sqoop.client.request.VersionRequest;
-import org.apache.sqoop.common.VersionInfo;
 import org.apache.sqoop.json.VersionBean;
 import org.codehaus.groovy.tools.shell.IO;
 
 @SuppressWarnings("serial")
 public class ShowVersionFunction extends SqoopFunction
 {
-  public static final String ALL = "all";
-  public static final String SERVER = "server";
-  public static final String CLIENT = "client";
-  public static final String PROTOCOL = "protocol";
+
 
   private IO io;
   private VersionRequest versionRequest;
 
+
   @SuppressWarnings("static-access")
   protected ShowVersionFunction(IO io) {
     this.io = io;
 
     this.addOption(OptionBuilder
-        .withDescription("Display all versions")
-        .withLongOpt(ALL)
-        .create(ALL.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_ALL_VERSIONS))
+        .withLongOpt(Constants.OPT_ALL)
+        .create(Constants.OPT_ALL_CHAR));
     this.addOption(OptionBuilder
-        .withDescription("Display server version")
-        .withLongOpt(SERVER)
-        .create(SERVER.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_VERSION_SERVER))
+        .withLongOpt(Constants.OPT_SERVER)
+        .create(Constants.OPT_SERVER_CHAR));
     this.addOption(OptionBuilder
-        .withDescription("Display client version")
-        .withLongOpt(CLIENT)
-        .create(CLIENT.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_VERSION_CLIENT))
+        .withLongOpt(Constants.OPT_CLIENT)
+        .create(Constants.OPT_CLIENT_CHAR));
     this.addOption(OptionBuilder
-        .withDescription("Display protocol version")
-        .withLongOpt(PROTOCOL)
-        .create(PROTOCOL.charAt(0)));
+        .withDescription(getResource().getString(Constants
+            .RES_SHOW_PROMPT_DISPLAY_VERSION_PROTOCOL))
+        .withLongOpt(Constants.OPT_PROTOCOL)
+        .create(Constants.OPT_PROTOCOL_CHAR));
   }
 
   public void printHelp(PrintWriter out) {
-    out.println("Usage: show version");
+    out.println(getResource().getString(Constants.RES_SHOW_VERSION_USAGE));
     super.printHelp(out);
   }
 
@@ -75,18 +79,18 @@ public class ShowVersionFunction extends SqoopFunction
     }
 
     CommandLine line = parseOptions(this, 1, args);
-    if (line.hasOption(ALL)) {
+    if (line.hasOption(Constants.OPT_ALL)) {
       showVersion(true, true, true);
 
     } else {
       boolean server = false, client = false, protocol = false;
-      if (line.hasOption(SERVER)) {
+      if (line.hasOption(Constants.OPT_SERVER)) {
         server = true;
       }
-      if (line.hasOption(CLIENT)) {
+      if (line.hasOption(Constants.OPT_CLIENT)) {
         client = true;
       }
-      if (line.hasOption(PROTOCOL)) {
+      if (line.hasOption(Constants.OPT_PROTOCOL)) {
         protocol = true;
       }
 
@@ -102,37 +106,32 @@ public class ShowVersionFunction extends SqoopFunction
     }
     VersionBean versionBean =
         versionRequest.doGet(Environment.getServerUrl());
+    MessageFormat msg;
+    String s;
 
     if (server) {
-      io.out.println("@|bold Server version:|@");
-      io.out.print("  Sqoop ");
-      io.out.print(versionBean.getVersion());
-      io.out.print(" revision ");
-      io.out.println(versionBean.getRevision());
-      io.out.print("  Compiled by ");
-      io.out.print(versionBean.getUser());
-      io.out.print(" on ");
-      io.out.println(versionBean.getDate());
+      s = MessageFormat.format(getResource().getString(Constants
+          .RES_SHOW_PROMPT_VERSION_CLIENT_SERVER), Constants.OPT_SERVER,
+          versionBean.getVersion(), versionBean.getRevision(),
+          versionBean.getUser(), versionBean.getDate());
+      io.out.println(StringEscapeUtils.unescapeJava(s));
     }
 
     if (client) {
-      io.out.println("@|bold Client version:|@");
-      io.out.print("  Sqoop ");
-      io.out.print(VersionInfo.getVersion());
-      io.out.print(" revision ");
-      io.out.println(VersionInfo.getRevision());
-      io.out.print("  Compiled by ");
-      io.out.print(VersionInfo.getUser());
-      io.out.print(" on ");
-      io.out.println(VersionInfo.getDate());
+      s = MessageFormat.format(getResource().getString(Constants
+          .RES_SHOW_PROMPT_VERSION_CLIENT_SERVER), Constants.OPT_CLIENT,
+          versionBean.getVersion(), versionBean.getRevision(),
+          versionBean.getUser(), versionBean.getDate());
+      io.out.println(StringEscapeUtils.unescapeJava(s));
     }
 
     if (protocol) {
-      io.out.println("@|bold Protocol version:|@");
-      io.out.print("  ");
-      io.out.println(Arrays.toString(versionBean.getProtocols()));
+      s = MessageFormat.format(getResource().getString(Constants
+          .RES_SHOW_PROMPT_VERSION_PROTOCOL), Arrays.toString(versionBean.
+          getProtocols()));
+      io.out.println(StringEscapeUtils.unescapeJava(s));
     }
 
     io.out.println();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
index 9ae693e..d818353 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
@@ -21,13 +21,10 @@ import groovy.lang.GroovyShell;
 import groovy.lang.MissingPropertyException;
 import groovy.lang.Script;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.*;
 
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 import org.codehaus.groovy.tools.shell.ComplexCommandSupport;
 import org.codehaus.groovy.tools.shell.Shell;
@@ -41,6 +38,13 @@ public abstract class SqoopCommand extends ComplexCommandSupport
   private String usage;
   private String help;
 
+  private static final ResourceBundle clientResource =
+      ResourceBundle.getBundle(Constants.RESOURCE_NAME);
+
+  protected  ResourceBundle getResource() {
+    return clientResource;
+  }
+
   @SuppressWarnings("unchecked")
   protected SqoopCommand(Shell shell, String name, String shortcut,
       String[] funcs, String descriptionPrefix, String descriptionPostfix) {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java
index 200b3ee..5632bac 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java
@@ -20,6 +20,7 @@ package org.apache.sqoop.client.shell;
 import java.io.PrintWriter;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ResourceBundle;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
@@ -28,16 +29,24 @@ import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.sqoop.client.core.ClientError;
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.common.SqoopException;
 
 @SuppressWarnings("serial")
 public class SqoopFunction extends Options
 {
+  private static final ResourceBundle clientResource =
+      ResourceBundle.getBundle(Constants.RESOURCE_NAME);
+
   public void printHelp(PrintWriter out) {
     HelpFormatter formatter = new HelpFormatter();
     formatter.printOptions(out, formatter.getWidth(), this, 0, 4);
   }
 
+  protected  ResourceBundle getResource() {
+    return clientResource;
+  }
+
   protected CommandLine parseOptions(Options options,
       int start, List<String> arglist) {
     Iterator<String> iterator = arglist.iterator();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/a32d8d1c/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java b/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java
index b2d05f4..6b632cb 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java
@@ -21,9 +21,12 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.ResourceBundle;
 
+import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.client.utils.ThrowableDisplayer;
 import org.codehaus.groovy.runtime.MethodClosure;
 import org.codehaus.groovy.tools.shell.Command;
@@ -44,11 +47,14 @@ public final class SqoopShell {
    */
   private static final String RC_FILE = ".sqoop2rc";
 
+
+
+  private static final ResourceBundle clientResource =
+      ResourceBundle.getBundle(Constants.RESOURCE_NAME);
   /**
    * Banner message that is displayed in interactive mode after client start.
    */
-  private static final String BANNER =
-      "@|green Sqoop Shell:|@ Type '@|bold help|@' or '@|bold \\h|@' for help.";
+
 
   /**
    * Hash of commands that we want to have in history in all cases.
@@ -69,7 +75,7 @@ public final class SqoopShell {
    */
   public static void main (String[] args) throws Exception
   {
-    System.setProperty("groovysh.prompt", "sqoop");
+    System.setProperty("groovysh.prompt", Constants.SQOOP_PROMPT);
     Groovysh shell = new Groovysh();
 
     // Install our error hook (exception handling)
@@ -100,19 +106,22 @@ public final class SqoopShell {
 
     // Let's see if user do have resource file with initial commands that he
     // would like to apply.
-    String homeDir = System.getProperty("user.home");
+    String homeDir = System.getProperty(Constants.PROP_HOMEDIR);
     File rcFile = new File(homeDir, RC_FILE);
 
     if(rcFile.exists()) {
-      shell.getIo().out.println("Loading resource file " + RC_FILE);
+      shell.getIo().out.println(MessageFormat.format(clientResource.getString
+          (Constants.RES_SQOOP_PROMPT_SHELL_LOADRC), RC_FILE));
       interpretFileContent(rcFile, shell);
-      shell.getIo().out.println("Resource file loaded.");
+      shell.getIo().out.println(clientResource.getString(clientResource.getString
+          (Constants.RES_SQOOP_PROMPT_SHELL_LOADEDRC)));
     }
 
     if (args.length == 0) {
       // Interactive mode:
       shell.getIo().setVerbosity(Verbosity.QUIET);
-      shell.getIo().out.println(BANNER);
+      shell.getIo().out.println(clientResource.getString(Constants
+          .RES_SQOOP_SHELL_BANNER));
       shell.getIo().out.println();
       shell.run(args);
 
@@ -120,7 +129,7 @@ public final class SqoopShell {
       // Batch mode (with a script file):
       File script = new File(args[0]);
       if (!script.isAbsolute()) {
-        String userDir = System.getProperty("user.dir");
+        String userDir = System.getProperty(Constants.PROP_CURDIR);
         script = new File(userDir, args[0]);
       }
 


Mime
View raw message