[jsword-svn] r1649 - trunk/jsword/src/main/java/org/crosswire/jsword/book

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Mon Aug 6 18:46:23 MST 2007


Author: dmsmith
Date: 2007-08-06 18:46:23 -0700 (Mon, 06 Aug 2007)
New Revision: 1649

Modified:
   trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.properties
Log:
Broke out hard-coded BookCategory names so it can be internationalized.
Improve xsl a bit more for rtl languages.

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java	2007-08-07 01:46:18 UTC (rev 1648)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java	2007-08-07 01:46:23 UTC (rev 1649)
@@ -36,47 +36,47 @@
     /**
      * Books that are Bibles
      */
-    public static final BookCategory BIBLE = new BookCategory("Bible"); //$NON-NLS-1$
+    public static final BookCategory BIBLE = new BookCategory(Msg.BIBLE);
 
     /**
      * Books that are Dictionaries
      */
-    public static final BookCategory DICTIONARY = new BookCategory("Dictionary"); //$NON-NLS-1$
+    public static final BookCategory DICTIONARY = new BookCategory(Msg.DICTIONARY);
 
     /**
      * Books that are Commentaries
      */
-    public static final BookCategory COMMENTARY = new BookCategory("Commentary"); //$NON-NLS-1$
+    public static final BookCategory COMMENTARY = new BookCategory(Msg.COMMENTARY);
 
     /**
      * Books that are indexed by day. AKA, Daily Devotions
      */
-    public static final BookCategory DAILY_DEVOTIONS = new BookCategory("Daily Devotional"); //$NON-NLS-1$
+    public static final BookCategory DAILY_DEVOTIONS = new BookCategory(Msg.READINGS);
 
     /**
      * Books that map words from one language to another.
      */
-    public static final BookCategory GLOSSARY = new BookCategory("Glossaries"); //$NON-NLS-1$
+    public static final BookCategory GLOSSARY = new BookCategory(Msg.GLOSSARIES);
 
     /**
      * Books that are questionable.
      */
-    public static final BookCategory QUESTIONABLE = new BookCategory("Cults / Unorthodox / Questionable Material"); //$NON-NLS-1$
+    public static final BookCategory QUESTIONABLE = new BookCategory(Msg.UNORTHODOX);
 
     /**
      * Books that are not any of the above
      */
-    public static final BookCategory GENERAL_BOOK = new BookCategory("General Books"); //$NON-NLS-1$
+    public static final BookCategory GENERAL_BOOK = new BookCategory(Msg.GENERAL);
 
     /**
      * Books that are not any of the above
      */
-    public static final BookCategory OTHER = new BookCategory("Other"); //$NON-NLS-1$
+    public static final BookCategory OTHER = new BookCategory(Msg.OTHER);
 
     /**
      * @param name The name of the BookCategory
      */
-    private BookCategory(String name)
+    private BookCategory(Msg name)
     {
         this.name = name;
     }
@@ -89,7 +89,7 @@
         for (int i = 0; i < VALUES.length; i++)
         {
             BookCategory o = VALUES[i];
-            if (o.name.equalsIgnoreCase(name))
+            if (o.name.toString().equalsIgnoreCase(name))
             {
                 return o;
             }
@@ -111,7 +111,7 @@
     public int compareTo(Object o)
     {
         BookCategory that = (BookCategory) o;
-        return this.name.compareTo(that.name);
+        return this.name.toString().compareTo(that.name.toString());
     }
 
     /* (non-Javadoc)
@@ -135,13 +135,13 @@
      */
     public String toString()
     {
-        return name;
+        return name.toString();
     }
 
     /**
      * The name of the BookCategory
      */
-    private String name;
+    private Msg name;
 
     // Support for serialization
     private static int nextObj;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.java	2007-08-07 01:46:18 UTC (rev 1648)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.java	2007-08-07 01:46:23 UTC (rev 1649)
@@ -14,7 +14,7 @@
  *      59 Temple Place - Suite 330
  *      Boston, MA 02111-1307, USA
  *
- * Copyright: 2005
+ * Copyright: 2007
  *     The copyright to this program is held by it's authors.
  *
  * ID: $Id$
@@ -29,28 +29,29 @@
  * @see gnu.lgpl.License for license details.
  *      The copyright to this program is held by it's authors.
  * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
  */
 final class Msg extends MsgBase
 {
-    static final Msg BOOK_NOREMOVE = new Msg("Books.BookNoRemove"); //$NON-NLS-1$
-    static final Msg DUPLICATE_DRIVER = new Msg("Books.DuplicateDriver"); //$NON-NLS-1$
-    static final Msg DRIVER_NOREMOVE = new Msg("Books.DriverNoRemove"); //$NON-NLS-1$
-    static final Msg JOB_TITLE = new Msg("Books.JobTitle"); //$NON-NLS-1$
-    static final Msg JOB_DRIVER = new Msg("Books.JobDriver"); //$NON-NLS-1$
-
+    
     static final Msg BIBLE_NOTFOUND = new Msg("Defaults.BibleNotFound"); //$NON-NLS-1$
     static final Msg DICTIONARY_NOTFOUND = new Msg("Defaults.DictionaryNotFound"); //$NON-NLS-1$
     static final Msg COMMENTARY_NOTFOUND = new Msg("Defaults.CommentaryNotFound"); //$NON-NLS-1$
+    static final Msg BIBLE = new Msg("BookCategory.Bible"); //$NON-NLS-1$
+    static final Msg DICTIONARY = new Msg("BookCategory.Dictionary"); //$NON-NLS-1$
+    static final Msg COMMENTARY = new Msg("BookCategory.Commentary"); //$NON-NLS-1$
+    static final Msg READINGS = new Msg("BookCategory.Readings"); //$NON-NLS-1$
+    static final Msg GLOSSARIES = new Msg("BookCategory.Glossaries"); //$NON-NLS-1$
+    static final Msg UNORTHODOX = new Msg("BookCategory.Unorthodox"); //$NON-NLS-1$
+    static final Msg GENERAL = new Msg("BookCategory.General"); //$NON-NLS-1$
+    static final Msg OTHER = new Msg("BookCategory.Other"); //$NON-NLS-1$
 
     static final Msg MISSING_VERSE = new Msg("OSISUtil.MissingVerse"); //$NON-NLS-1$
     static final Msg OSIS_BADID = new Msg("OSISUtil.OSISBadID"); //$NON-NLS-1$
 
-    static final Msg BOOK_METADATA_SET_OTHER = new Msg("BookSet.Other"); //$NON-NLS-1$
+    static final Msg BOOK_NOREMOVE = new Msg("Books.BookNoRemove"); //$NON-NLS-1$
+    static final Msg DRIVER_NOREMOVE = new Msg("Books.DriverNoRemove"); //$NON-NLS-1$
 
-    static final Msg STRONGS_GREEK = new Msg("Strongs.Greek"); //$NON-NLS-1$
-    static final Msg STRONGS_HEBREW = new Msg("Strongs.Hebrew"); //$NON-NLS-1$
-    static final Msg STRONGS_PARSING = new Msg("Strongs.Parsing"); //$NON-NLS-1$
-
     /**
      * Passthrough ctor
      */

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.properties	2007-08-07 01:46:18 UTC (rev 1648)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Msg.properties	2007-08-07 01:46:23 UTC (rev 1649)
@@ -5,20 +5,22 @@
 # The MessageName should be mixed case, with a leading capital.
 # It should have no spaces or other punctuation (e.g. _, -, ', ...)
 
-Books.BookNoRemove=Could not remove unregistered Book
-Books.DuplicateDriver=Driver already registered
-Books.DriverNoRemove=Could not remove unregistered Driver
-Books.JobTitle=Registering Drivers
-Books.JobDriver=Registering Driver:
-
 Defaults.BibleNotFound=Bible called "{0}" could not be found.
 Defaults.DictionaryNotFound=Dictionary called "{0}" could not be found.
 Defaults.CommentaryNotFound=Commentary called "{0}" could not be found.
 
+BookCategory.Bible=Bible
+BookCategory.Dictionary=Dictionary
+BookCategory.Commentary=Commentary
+BookCategory.Readings=Daily Devotional
+BookCategory.Glossaries=Glossaries
+BookCategory.Unorthodox=Cults / Unorthodox / Questionable Material
+BookCategory.General=General Books
+BookCategory.Other=Other
+
+# The following are very uncommon and represent programmer's errors
+Books.BookNoRemove=Could not remove unregistered Book
+Books.DriverNoRemove=Could not remove unregistered Driver
+
 OSISUtil.MissingVerse=Verse element could not be found
 OSISUtil.OSISBadID=OsisID not valid: {0}
-
-BookSet.Other=Other
-
-SentenceUtil.ErrorMixed=MIXED case should only exist with LORD''s
-SentenceUtil.ErrorBadcase=Case must be 0-3




More information about the jsword-svn mailing list