You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/04/02 18:56:28 UTC
svn commit: r1584092 - in /sis/branches/JDK7/application/sis-console/src:
main/java/org/apache/sis/console/ main/resources/org/apache/sis/console/
test/java/org/apache/sis/console/
Author: desruisseaux
Date: Wed Apr 2 16:56:28 2014
New Revision: 1584092
URL: http://svn.apache.org/r1584092
Log:
Add explicit resources for English locale, even if they just inherit all their resources from the default locale,
in order to allow the "--locale en" option to work on non-English systems.
Added:
sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties (with props)
sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties (with props)
Modified:
sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java
sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/HelpSCTest.java
Modified: sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java?rev=1584092&r1=1584091&r2=1584092&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java [UTF-8] Wed Apr 2 16:56:28 2014
@@ -29,7 +29,7 @@ import org.apache.sis.util.resources.Voc
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.3
+ * @version 0.4
* @module
*/
final class HelpSC extends SubCommand {
@@ -40,7 +40,8 @@ final class HelpSC extends SubCommand {
"help",
"about",
"mime-type",
- "metadata"
+ "metadata",
+ "crs"
};
/**
Added: sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties?rev=1584092&view=auto
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties (added)
+++ sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties [ISO-8859-1] Wed Apr 2 16:56:28 2014
@@ -0,0 +1 @@
+# Inherit all resources from Commands.properties
Propchange: sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Commands_en.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=ISO-8859-1
Added: sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties?rev=1584092&view=auto
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties (added)
+++ sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties [ISO-8859-1] Wed Apr 2 16:56:28 2014
@@ -0,0 +1 @@
+# Inherit all resources from Options.properties
Propchange: sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK7/application/sis-console/src/main/resources/org/apache/sis/console/Options_en.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=ISO-8859-1
Modified: sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/HelpSCTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/HelpSCTest.java?rev=1584092&r1=1584091&r2=1584092&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/HelpSCTest.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/HelpSCTest.java [UTF-8] Wed Apr 2 16:56:28 2014
@@ -71,4 +71,32 @@ public final strictfp class HelpSCTest e
assertFalse("--verbose", result.contains("--verbose"));
assertTrue ("--help", result.contains("--help"));
}
+
+ /**
+ * Tests the sub-command with the {@code --locale en} option.
+ *
+ * @throws InvalidOptionException Should never happen.
+ */
+ @Test
+ public void testEnglishLocale() throws InvalidOptionException {
+ final HelpSC test = new HelpSC(0, SubCommand.TEST, "--help", "--locale", "en");
+ test.help("help");
+ final String result = test.outputBuffer.toString();
+ assertTrue(result, result.contains("Show a help overview."));
+ assertTrue(result, result.contains("The locale to use"));
+ }
+
+ /**
+ * Tests the sub-command with the {@code --locale fr} option.
+ *
+ * @throws InvalidOptionException Should never happen.
+ */
+ @Test
+ public void testFrenchLocale() throws InvalidOptionException {
+ final HelpSC test = new HelpSC(0, SubCommand.TEST, "--help", "--locale", "fr");
+ test.help("help");
+ final String result = test.outputBuffer.toString();
+ assertTrue(result, result.contains("Affiche un écran d’aide."));
+ assertTrue(result, result.contains("Les paramètres régionaux"));
+ }
}