You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/06/03 23:11:11 UTC
svn commit: r411470 - in /geronimo/sandbox/gshell/trunk: ./
gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/
gshell-core/src/main/resources/org/
gshell-core/src/main/resources/org/apache/
gshell-core/src/main/resources/org/apache/geronimo...
Author: jdillon
Date: Sat Jun 3 14:11:11 2006
New Revision: 411470
URL: http://svn.apache.org/viewvc?rev=411470&view=rev
Log:
Testing to see how to introduce externalized strings using RB, this will help bring about i18n support
Added:
geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/
geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/
geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/
geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/
geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/
geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties (with props)
Modified:
geronimo/sandbox/gshell/trunk/NOTES.txt
geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/SetCommand.java
Modified: geronimo/sandbox/gshell/trunk/NOTES.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/NOTES.txt?rev=411470&r1=411469&r2=411470&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/NOTES.txt (original)
+++ geronimo/sandbox/gshell/trunk/NOTES.txt Sat Jun 3 14:11:11 2006
@@ -38,8 +38,6 @@
* * *
- * * *
-
Settings, read from ~/.gshell/...
@@ -91,3 +89,6 @@
/vfs/browser ftp://whatever
...
+Hook up message bundles to externalized strings for commands,
+ Maybe provide that as a standard hook for commands
+ Try to extern all messages (including --help bits), so we can i18n
Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/SetCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/SetCommand.java?rev=411470&r1=411469&r2=411470&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/SetCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/SetCommand.java Sat Jun 3 14:11:11 2006
@@ -28,6 +28,7 @@
import org.apache.geronimo.gshell.console.IO;
import java.util.Iterator;
+import java.util.ResourceBundle;
/**
* Set a variable or property.
@@ -51,6 +52,13 @@
assert args != null;
//
+ // TODO: Sub-class, create a Spring-like MessageSource, using Varags + printf
+ // Add to commmand context interface
+ //
+
+ ResourceBundle resources = ResourceBundle.getBundle(getClass().getName() + "Messages");
+
+ //
// TODO: Optimize, move common code to CommandSupport
//
@@ -59,11 +67,11 @@
Options options = new Options();
options.addOption(OptionBuilder.withLongOpt("help")
- .withDescription("Display this help message")
+ .withDescription(resources.getString("cli.option.help"))
.create('h'));
options.addOption(OptionBuilder.withLongOpt("property")
- .withDescription("Set a system property")
+ .withDescription(resources.getString("cli.option.property"))
.create('p'));
//
@@ -78,7 +86,9 @@
CommandLine line = parser.parse(options, args);
if (line.hasOption('h')) {
- io.out.println(getName() + " -- set a variable or property");
+ io.out.print(getName());
+ io.out.print(" -- ");
+ io.out.println(resources.getString("cli.usage.description"));
io.out.println();
HelpFormatter formatter = new HelpFormatter();
@@ -93,6 +103,8 @@
"",
false); // auto usage
+ io.out.println();
+ io.out.println(resources.getString("cli.usage.footer")); //
io.out.println();
return Command.SUCCESS;
Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties?rev=411470&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties (added)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties Sat Jun 3 14:11:11 2006
@@ -0,0 +1,19 @@
+##
+## $Id$
+##
+
+##
+## Option descriptions
+##
+
+cli.option.help=Display this help message
+
+cli.option.property=Set a system property
+
+##
+## Option usage (help)
+##
+
+cli.usage.description=Set a variable or property
+
+cli.usage.footer=With no arguments, current variables are displayed as name=value
\ No newline at end of file
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/SetCommandMessages.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain