db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r1727230 - in /db/derby/code/trunk/java: build/org/apache/derbyBuild/ tools/org/apache/derby/loc/ tools/org/apache/derby/tools/
Date Thu, 28 Jan 2016 02:25:25 GMT
Author: bpendleton
Date: Thu Jan 28 02:25:25 2016
New Revision: 1727230

URL: http://svn.apache.org/viewvc?rev=1727230&view=rev
Log:
DERBY-5944: The hard-coded PlanExporter help message should be internationalized

This patch was contributed by  Yun Fang ( fangyuncn at gmail dot com  )

This change replaces the literal string text in PlanExporter.java with
references to Derby messages.

The change also contributes both the English message text and the corresponding
Chinese message text.


Modified:
    db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageVetter.java
    db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties
    db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages_zh_CN.properties
    db/derby/code/trunk/java/tools/org/apache/derby/tools/PlanExporter.java

Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageVetter.java?rev=1727230&r1=1727229&r2=1727230&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageVetter.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageVetter.java Thu Jan 28 02:25:25
2016
@@ -98,6 +98,7 @@ public class MessageVetter {
         // needs quoting.
         LONE_QUOTE_ALLOWED.add("DRDA_Usage8.I");
         LONE_QUOTE_ALLOWED.add("DRDA_Usage11.I");
+        LONE_QUOTE_ALLOWED.add("PE_HelpText");
     }
 
     /** The message file to check. */

Modified: db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties?rev=1727230&r1=1727229&r2=1727230&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties Thu Jan 28
02:25:25 2016
@@ -411,3 +411,44 @@ OT_BadLoadUnloadArgs=Bad arguments passe
 # arg1 = the name of a foreign data type returned by java.sql.DatabaseMetaData.getColumns().getString(
6 )
 OT_UnknownForeignDataType=Unknown external data type. JDBC type = {0}, external type name
= {1}.
 
+#
+#Messages for the PlanExporter.java
+#
+
+PE_HelpText=\
+================================================\n\
+\               PlanExporter Tool                \n\
+\     You can pass 5 arguments (minimum), or     \n\
+\         7 arguments or 8 arguments or          \n\
+\             9 arguments (maximum)              \n\
+\           separated by a space.                \n\
+\               Mandatory Arguments              \n\
+1) database URL                                 \n\
+2) database schema                              \n\
+3) statement ID (36 characters)                 \n\
+\               Optional Arguments               \n\
+\           Choose at least one option           \n\
+a) -xml '{'pathToXML'}' or -html '{'pathToHTML'}'       \n\
+b) -xml '{'pathToXML'}' -html '{'pathToHTML'}'          \n\
+c) -xsl '{'pathToXSL'}' -html '{'pathToHTML'}'          \n\
+d) -xml '{'pathToXML'}' -xsl '{'pathToXSL'}'            \n\
+\      -html '{'pathToHTML'}'                        \n\
+e) -adv -xml '{'pathToXML'}' -xsl '{'pathToXSL'}'       \n\
+================================================\n
+
+PE_NoStatisticsCaptured=\
+====================================================\n\
+\    An Error Occured: No Statistics has Captured    \n\
+\   Possible reasons:                                \n\
+\   1) The statement executed is a DDL statement.    \n\
+\   Statistics will not capture for DDL statements   \n\
+\   by the Derby.                                    \n\
+\   2) The statement ID entered is incorrect.        \n\
+\   3) Schema specified does not exist.              \n\
+====================================================\n
+
+PE_ErrorSchemaNotExist=\
+====================================================\n\
+\                 An Error Occured:                  \n\
+\          Specified Schema does not exist.          \n\
+======================================================

Modified: db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages_zh_CN.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages_zh_CN.properties?rev=1727230&r1=1727229&r2=1727230&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages_zh_CN.properties (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages_zh_CN.properties Thu
Jan 28 02:25:25 2016
@@ -280,3 +280,42 @@ SC_NO_CONN=\u65E0\u6CD5\u83B7\u53D6\u8FD
 SC_FOUND_MATCH=\u627E\u5230 {0} \u7684\u5339\u914D\u65B9\u6CD5
 SC_UNRESOLVABLE=\u65E0\u6CD5\u89E3\u6790\u7684\u4F8B\u884C\u7A0B\u5E8F\uFF1A{0}\u3002\u8BE6\u7EC6\u539F\u56E0\uFF1A{1}
 
+#
+#Messages for the PlanExporter.java
+#
+
+PE_HelpText=\
+================================================\n\
+\               PlanExporter\u5DE5\u5177                \n\
+\     \u53EF\u4EE5\u4F205\u4E2A\u53C2\u6570(\u6700\u5C11), \u6216     \n\
+\         7\u4E2A\u62168\u4E2A\u62169\u4E2A\u53C2\u6570(\u6700\u591A)              \n\
+\           \u4EE5\u7A7A\u767D\u7B26\u95F4\u9694.                \n\
+\               \u5FC5\u8981\u53C2\u6570              \n\
+1) \u6570\u636E\u5E93URL                                 \n\
+2) \u6570\u636E\u5E93\u65B9\u6848\u540D                              \n\
+3) \u8BED\u53E5ID (36\u5B57\u7B26)                 \n\
+\               \u53EF\u9009\u53C2\u6570               \n\
+\           \u81F3\u5C11\u5305\u542B\u4E00\u4E2A\u53C2\u6570           \n\
+a) -xml '{'XML\u6587\u4EF6\u8DEF\u5F84'}' or -html '{'HTML\u6587\u4EF6\u8DEF\u5F84'}'   
   \n\
+b) -xml '{'XML\u6587\u4EF6\u8DEF\u5F84'}' -html '{'HTML\u6587\u4EF6\u8DEF\u5F84'}'      
   \n\
+c) -xsl '{'XSL\u6587\u4EF6\u8DEF\u5F84'}' -html '{'HTML\u6587\u4EF6\u8DEF\u5F84'}'      
   \n\
+d) -xml '{'XML\u6587\u4EF6\u8DEF\u5F84'}' -xsl '{'XSL\u6587\u4EF6\u8DEF\u5F84'}'        
   \n\
+\      -html '{'HTML\u6587\u4EF6\u8DEF\u5F84'}'                        \n\
+e) -adv -xml '{'XML\u6587\u4EF6\u8DEF\u5F84'}' -xsl '{'XSL\u6587\u4EF6\u8DEF\u5F84'}'   
   \n\
+================================================\n
+
+PE_NoStatisticsCaptured=\
+====================================================\n\
+\    \u51FA\u73B0\u9519\u8BEF: \u6CA1\u6709\u83B7\u53D6\u5230\u7EDF\u8BA1\u4FE1\u606F   
\n\
+\   \u53EF\u80FD\u539F\u56E0:                                \n\
+\   1) \u6267\u884C\u7684\u8BED\u53E5\u662FDDL\u8BED\u53E5.    \n\
+\   Derby\u4E0D\u83B7\u53D6DDL\u8BED\u53E5\u7EDF\u8BA1\u4FE1\u606F   \n\
+\   2) \u8F93\u5165\u7684\u8BED\u53E5ID\u4E0D\u6B63\u786E.        \n\
+\   3) \u6307\u5B9A\u7684\u65B9\u6848\u4E0D\u5B58\u5728.              \n\
+====================================================\n
+
+PE_ErrorSchemaNotExist=\
+====================================================\n\
+\                 \u51FA\u73B0\u9519\u8BEF:                  \n\
+\          \u6307\u5B9A\u7684\u65B9\u6848\u4E0D\u5B58\u5728.          \n\
+======================================================

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/PlanExporter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/PlanExporter.java?rev=1727230&r1=1727229&r2=1727230&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/PlanExporter.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/PlanExporter.java Thu Jan 28 02:25:25
2016
@@ -29,6 +29,8 @@ import java.io.Writer;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+
+import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derby.impl.tools.planexporter.AccessDatabase;
 import org.apache.derby.impl.tools.planexporter.CreateHTMLFile;
 import org.apache.derby.impl.tools.planexporter.CreateXMLFile;
@@ -43,6 +45,8 @@ public class PlanExporter {
     private static final int XML=1;
     private static final int HTML=2;
     private static final int XSL=3;
+    
+    private static final LocalizedResource LOC_RES = LocalizedResource.getInstance();
 
     /**
      * @param args
@@ -179,25 +183,11 @@ public class PlanExporter {
                 			printHelp();
                 	}
                 	else{
-                		System.out.println(
-                				"====================================================\n" +
-                				"--- An Error Occured: No Statistics has Captured ---\n" +
-                				"-- Possible reasons:                              --\n" +
-                				"-- 1) The statement executed is a DDL statement.  --\n" +
-                				"-- Statistics will not capture for DDL statements --\n" +
-                				"-- by the Derby.                                  --\n" +
-                				"-- 2) The statement ID entered is incorrect.      --\n" +
-                				"-- 3) Schema specified does not exist.            --\n" +
-                				"====================================================\n"
-                		);
+                		System.out.println(LOC_RES.getTextMessage("PE_NoStatisticsCaptured"));
                 	}
                 }
                 else{
-                	System.out.println(
-            				"====================================================\n" +
-            				"---              An Error Occured:               ---\n" +
-            				"-------   Specified Schema does not exist.   -------\n" +
-            				"======================================================");
+                	System.out.println(LOC_RES.getTextMessage("PE_ErrorSchemaNotExist"));
                 }
             }
             else
@@ -283,28 +273,7 @@ public class PlanExporter {
     }
 
     private static void printHelp(){
-        System.out.println
-        (
-                "================================================\n" +
-                "-------------- PlanExporter Tool ---------------\n" +
-                "--   You can pass 5 arguments (minimum), or   --\n" +
-                "--       7 arguments or 8 arguments or        --\n" +
-                "-----------  9 arguments (maximum)  ------------\n" +
-                "--         separated by a space.              --\n" +
-                "---------------Mandatory Arguments--------------\n" +
-                "1) database URL --------------------------------\n" +
-                "2) database schema -----------------------------\n" +
-                "3) statement ID (36 characters) ----------------\n" +
-                "---------------Optional Arguments---------------\n" +
-                "-----------Choose at least one option-----------\n" +
-                "a) -xml {pathToXML} or -html {pathToHTML} ------\n" +
-                "b) -xml {pathToXML} -html {pathToHTML} ---------\n" +
-                "c) -xsl {pathToXSL} -html {pathToHTML} ---------\n" +
-                "d) -xml {pathToXML} -xsl {pathToXSL} -----------\n" +
-                "      -html {pathToHTML} -----------------------\n" +
-                "e) -adv -xml {pathToXML} -xsl {pathToXSL} ------\n" +
-                "================================================\n"
-        );
+        System.out.println(LOC_RES.getTextMessage("PE_HelpText"));
     }
 
     private static void deleteFile(final String fileName)



Mime
View raw message