[jsword-svn] r1525 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/book common/src/main/java/org/crosswire/common/icu common/src/main/java/org/crosswire/common/util jsword/src/main/java/org/crosswire/jsword/book/readings jsword/src/main/java/org/crosswire/jsword/book/sword

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Tue Jul 24 15:08:34 MST 2007


Author: dmsmith
Date: 2007-07-24 15:08:34 -0700 (Tue, 24 Jul 2007)
New Revision: 1525

Added:
   trunk/common/src/main/java/org/crosswire/common/icu/DateFormatter.java
Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.properties
   trunk/common/src/main/java/org/crosswire/common/icu/NumberShaper.java
   trunk/common/src/main/java/org/crosswire/common/util/MsgBase.java
   trunk/common/src/main/java/org/crosswire/common/util/ReporterEvent.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsKey.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDailyDevotion.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java
Log:
Added the showing of dates in Farsi.
Made numbers in Msg strings be shaped when needed.
Likewise for ReporterEvent events.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -88,6 +88,8 @@
     private void initialize()
     {
         shaper = new NumberShaper();
+        presetStart = Msg.PRESET_START.toString();
+        presetEnd = Msg.PRESET_END.toString();
 
         actions = new ActionFactory(AdvancedSearchPane.class, this);
 
@@ -479,8 +481,8 @@
         String preset = (String) cboPresets.getSelectedItem();
         if (preset != null)
         {
-            int open = preset.indexOf(PRESET_START);
-            int close = preset.indexOf(PRESET_END);
+            int open = preset.indexOf(presetStart);
+            int close = preset.indexOf(presetEnd);
 
             if (open != -1 && close != -1)
             {
@@ -570,7 +572,7 @@
         editingRestrict = true;
         boolean match = false;
         ComboBoxModel model = cboPresets.getModel();
-        String find = PRESET_START + restrict + PRESET_END;
+        String find = presetStart + restrict + presetEnd;
         for (int i = 0; !match && i < model.getSize(); i++)
         {
             String element = (String) model.getElementAt(i);
@@ -675,9 +677,9 @@
      */
     private static final String SPACE = " "; //$NON-NLS-1$
 
-    private static final String PRESET_END = ")"; //$NON-NLS-1$
+    private String presetEnd;
 
-    private static final String PRESET_START = "("; //$NON-NLS-1$
+    private String presetStart;
 
     /**
      * If escape was pressed we don't want to update the parent

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -313,8 +313,8 @@
             int total = results.getCardinality();
             int partial = total;
 
-            // we get PassageTallys for rank searches
-            if (results instanceof PassageTally || rank)
+            // we should get PassageTallys for rank searches
+            if (results instanceof PassageTally)
             {
                 PassageTally tally = (PassageTally) results;
                 tally.setOrdering(PassageTally.ORDER_TALLY);

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -61,6 +61,8 @@
     static final Msg ERROR = new Msg("PassageSelectionPane.Error"); //$NON-NLS-1$
     static final Msg SUMMARY = new Msg("PassageSelectionPane.Summary"); //$NON-NLS-1$
 
+    static final Msg PRESET_START = new Msg("AdvancedSearchPane.PresetStart"); //$NON-NLS-1$
+    static final Msg PRESET_END = new Msg("AdvancedSearchPane.PresetEnd"); //$NON-NLS-1$
     static final Msg PRESETS = new Msg("AdvancedSearchPane.Presets"); //$NON-NLS-1$
     static final Msg ADVANCED_SELECT_TITLE = new Msg("AdvancedSearchPane.SelectPassageTitle"); //$NON-NLS-1$
     static final Msg RANK = new Msg("AdvancedSearchPane.Rank"); //$NON-NLS-1$

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.properties	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.properties	2007-07-24 22:08:34 UTC (rev 1525)
@@ -40,6 +40,8 @@
 PassageSelectionPane.Error=Error: {0}
 PassageSelectionPane.Summary=Summary: {0}
 
+AdvancedSearchPane.PresetStart=(
+AdvancedSearchPane.PresetStart=)
 AdvancedSearchPane.Presets=The Whole Bible|\
 	All Prophecy (Deu 28, Isa-Mal, Rev)|\
 	Old Testament (Gen-Mal)|\

Added: trunk/common/src/main/java/org/crosswire/common/icu/DateFormatter.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/icu/DateFormatter.java	                        (rev 0)
+++ trunk/common/src/main/java/org/crosswire/common/icu/DateFormatter.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -0,0 +1,185 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the Internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2007
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: org.eclipse.jdt.ui.prefs 1178 2006-11-06 12:48:02Z dmsmith $
+ */
+
+package org.crosswire.common.icu;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.crosswire.common.util.ReflectionUtil;
+
+import com.ibm.icu.text.DateFormat;
+
+/**
+ * DateFormat provides a wrapper of some of DateFormat and SimpleDateFormat
+ * using ICU4J if present, otherwise from core Java.
+ * Note, only those methods in DateFormat that are actually used are here.
+ * 
+ * @see gnu.lgpl.License for license details.<br>
+ *      The copyright to this program is held by it's authors.
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ */
+public class DateFormatter
+{
+    /**
+     * Prevent instantiation.
+     */
+    private DateFormatter()
+    {
+    }
+
+    /* (non-Javadoc)
+     * @see java.text.DateFormat#getDateInstance(int)
+     */
+    public static DateFormatter getDateInstance(int format)
+    {
+        DateFormatter fmt = new DateFormatter();
+        try
+        {
+            fmt.formatterClass = Class.forName("com.ibm.icu.text.DateFormat"); //$NON-NLS-1$
+            // To call a method taking a type of int, the type has to match but the object has to be wrapped
+            Class[] instanceTypes = { int.class };
+            Object[] instanceParams = { new Integer(format) };
+            fmt.formatter = ReflectionUtil.invoke(fmt.formatterClass, fmt.formatterClass, "getDateInstance", instanceParams, instanceTypes); //$NON-NLS-1$
+        }
+        catch (Exception e)
+        {
+            fmt.formatterClass = DateFormat.class;
+            fmt.formatter = DateFormat.getDateInstance(format);
+        }
+        return fmt;
+    }
+
+    /* (non-Javadoc)
+     * @see java.text.DateFormat#getDateInstance()
+     */
+    public static DateFormatter getDateInstance()
+    {
+        return getDateInstance(DEFAULT);
+    }
+
+    /* (non-Javadoc)
+     * @see java.text.DateFormat#getDateInstance(int)
+     */
+    public static DateFormatter getSimpleDateInstance(String format)
+    {
+        DateFormatter fmt = new DateFormatter();
+        try
+        {
+            fmt.formatterClass = Class.forName("com.ibm.icu.text.SimpleDateFormat"); //$NON-NLS-1$
+            Object[] instanceParams = { format };
+            fmt.formatter = ReflectionUtil.construct("com.ibm.icu.text.SimpleDateFormat", instanceParams); //$NON-NLS-1$
+        }
+        catch (Exception e)
+        {
+            fmt.formatterClass = SimpleDateFormat.class;
+            fmt.formatter = new SimpleDateFormat(format);
+        }
+        return fmt;
+    }
+
+    /* (non-Javadoc)
+     * @see java.text.DateFormat#setLenient(boolean)
+     */
+    public void setLenient(boolean lenient)
+    {
+        try
+        {
+            Class[] lenientTypes = { boolean.class };
+            Object[] lenientParams = { Boolean.valueOf(lenient) };
+            ReflectionUtil.invoke(formatterClass, formatter, "setLenient", lenientParams, lenientTypes); //$NON-NLS-1$
+        }
+        catch (Exception e)
+        {
+            // silently fail
+            assert false : e;
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.text.DateFormat#format(java.util.Date)
+     */
+    public String format(Date date)
+    {
+        try
+        {
+            Object[] formatParams = { date };
+            return (String) ReflectionUtil.invoke(formatterClass, formatter, "format", formatParams); //$NON-NLS-1$
+        }
+        catch (Exception e)
+        {
+            assert false : e;
+            return ""; //$NON-NLS-1$
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.text.DateFormat#parse(java.lang.String)
+     */
+    public Date parse(String text) throws ParseException
+    {
+        try
+        {
+            Object[] parseParams = { text };
+            return (Date) ReflectionUtil.invoke(formatterClass, formatter, "parse", parseParams); //$NON-NLS-1$
+        }
+        catch (Exception e)
+        {
+            if (e instanceof ParseException)
+            {
+                throw (ParseException) e;
+            }
+
+            assert false : e;
+            return new Date();
+        }
+    }
+
+    // Note these values are the same for Java and ICU4J
+    /**
+     * Constant for full style pattern.
+     */
+    public static final int FULL = 0;
+    /**
+     * Constant for long style pattern.
+     */
+    public static final int LONG = 1;
+    /**
+     * Constant for medium style pattern.
+     */
+    public static final int MEDIUM = 2;
+    /**
+     * Constant for short style pattern.
+     */
+    public static final int SHORT = 3;
+    /**
+     * Constant for default style pattern.  Its value is MEDIUM.
+     */
+    public static final int DEFAULT = MEDIUM;
+
+    /** The actual formatter. */
+    private Object formatter;
+
+    /** The class of the formatter */
+    private Class formatterClass;
+}

Modified: trunk/common/src/main/java/org/crosswire/common/icu/NumberShaper.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/icu/NumberShaper.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/common/src/main/java/org/crosswire/common/icu/NumberShaper.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -122,6 +122,11 @@
      */
     public String shape(String input)
     {
+        if (input == null)
+        {
+            return input;
+        }
+
         if (arabicShaper != null)
         {
             Object[] params = { input };

Modified: trunk/common/src/main/java/org/crosswire/common/util/MsgBase.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/MsgBase.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/common/src/main/java/org/crosswire/common/util/MsgBase.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -28,6 +28,8 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
+import org.crosswire.common.icu.NumberShaper;
+
 /**
  * A base class for implementing type safe internationalization (i18n) that is
  * easy for most cases. See {@link org.crosswire.common.util.Msg} for an
@@ -56,6 +58,7 @@
     protected MsgBase(String name)
     {
         this.name = name;
+        this.shaper = new NumberShaper();
         loadResources();
     }
 
@@ -65,19 +68,7 @@
     /* @Override */
     public String toString()
     {
-        try
-        {
-            if (resources != null)
-            {
-                return resources.getString(name);
-            }
-        }
-        catch (MissingResourceException ex)
-        {
-            log.error("Missing resource: Locale=" + Locale.getDefault().toString() + " name=" + name + " package=" + getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        }
-
-        return name;
+        return shaper.shape(obtainString());
     }
 
     /**
@@ -85,7 +76,7 @@
      */
     public String toString(Object param)
     {
-        return MessageFormat.format(toString(), new Object[] { param });
+        return shaper.shape(MessageFormat.format(obtainString(), new Object[] { param }));
     }
 
     /**
@@ -93,11 +84,11 @@
      */
     public String toString(Object[] params)
     {
-        return MessageFormat.format(toString(), params);
+        return shaper.shape(MessageFormat.format(obtainString(), params));
     }
 
     /**
-     * Initialise any resource bundles
+     * Initialize any resource bundles
      */
     protected final void loadResources()
     {
@@ -127,6 +118,23 @@
         }
     }
 
+    private String obtainString()
+    {
+        try
+        {
+            if (resources != null)
+            {
+                return resources.getString(name);
+            }
+        }
+        catch (MissingResourceException ex)
+        {
+            log.error("Missing resource: Locale=" + Locale.getDefault().toString() + " name=" + name + " package=" + getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        }
+
+        return name;
+    }
+
     private String name;
 
     /**
@@ -139,6 +147,9 @@
      */
     private ResourceBundle resources;
 
+    /** Internationalize numbers */
+    private NumberShaper shaper;
+
     /**
      * The log stream
      */

Modified: trunk/common/src/main/java/org/crosswire/common/util/ReporterEvent.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/ReporterEvent.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/common/src/main/java/org/crosswire/common/util/ReporterEvent.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -23,6 +23,8 @@
 
 import java.util.EventObject;
 
+import org.crosswire.common.icu.NumberShaper;
+
 /**
  * An event indicating that some bit of data needs capturing.
  *
@@ -55,7 +57,7 @@
         super(source);
 
         this.ex = null;
-        this.message = message;
+        this.message = new NumberShaper().shape(message);
     }
 
     /**

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -22,8 +22,7 @@
 package org.crosswire.jsword.book.readings;
 
 import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
@@ -88,12 +87,12 @@
         setBookMetaData(bmd);
 
         // Go through the current year
-        Calendar greg = new GregorianCalendar();
-        greg.set(Calendar.DAY_OF_MONTH, 1);
-        greg.set(Calendar.MONDAY, Calendar.JANUARY);
-        int currentYear = greg.get(Calendar.YEAR);
+        java.util.Calendar greg = new java.util.GregorianCalendar();
+        greg.set(java.util.Calendar.DAY_OF_MONTH, 1);
+        greg.set(java.util.Calendar.MONDAY, java.util.Calendar.JANUARY);
+        int currentYear = greg.get(java.util.Calendar.YEAR);
 
-        while (greg.get(Calendar.YEAR) == currentYear)
+        while (greg.get(java.util.Calendar.YEAR) == currentYear)
         {
             String internalKey = ReadingsKey.external2internal(greg);
             String readings = ""; //$NON-NLS-1$
@@ -108,7 +107,7 @@
                 log.warn("Missing resource: " + internalKey + " while parsing: " + setname); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-            greg.add(Calendar.DATE, 1);
+            greg.add(java.util.Calendar.DATE, 1);
         }
 
         global = new SetKeyList(hash.keySet(), getName());
@@ -119,8 +118,7 @@
      */
     public Key getPreferred()
     {
-        GregorianCalendar greg = new GregorianCalendar();
-        return new ReadingsKey(greg.getTime());
+        return new ReadingsKey(new Date());
     }
 
     public Iterator getOsisIterator(Key key, boolean allowEmpty) throws BookException

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsKey.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsKey.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsKey.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -21,13 +21,12 @@
  */
 package org.crosswire.jsword.book.readings;
 
-import java.text.DateFormat;
 import java.text.MessageFormat;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 
+import org.crosswire.common.icu.DateFormatter;
 import org.crosswire.jsword.passage.DefaultLeafKeyList;
 import org.crosswire.jsword.passage.Key;
 import org.crosswire.jsword.passage.NoSuchKeyException;
@@ -38,6 +37,7 @@
  * @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]
  */
 public class ReadingsKey extends DefaultLeafKeyList
 {
@@ -54,9 +54,9 @@
 
         try
         {
-            DateFormat nameDF = DateFormat.getDateInstance(DateFormat.MEDIUM);
-            nameDF.setLenient(true);
-            date = nameDF.parse(text);
+            DateFormatter formatter = DateFormatter.getDateInstance();
+            formatter.setLenient(true);
+            date = formatter.parse(text);
         }
         catch (ParseException ex)
         {
@@ -70,7 +70,7 @@
      */
     protected ReadingsKey(Date date)
     {
-        super(DateFormat.getDateInstance(DateFormat.MEDIUM).format(date), new SimpleDateFormat("d.MMMM").format(date)); //$NON-NLS-1$
+        super(DateFormatter.getDateInstance().format(date), DateFormatter.getSimpleDateInstance("d.MMMM").format(date)); //$NON-NLS-1$
         this.date = date;
     }
 
@@ -128,6 +128,11 @@
         return super.clone();
     }
 
+    /**
+     * Convert the Gregorian Calendar to a string.
+     * @param externalKey
+     * @return
+     */
     public static String external2internal(Calendar externalKey)
     {
         Object[] objs = {new Integer(1 + externalKey.get(Calendar.MONTH)),

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawLDBackend.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -24,12 +24,12 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 
 import org.crosswire.common.activate.Activator;
 import org.crosswire.common.activate.Lock;
+import org.crosswire.common.icu.DateFormatter;
 import org.crosswire.common.util.ClassUtil;
 import org.crosswire.common.util.FileUtil;
 import org.crosswire.common.util.Logger;
@@ -139,7 +139,7 @@
         boolean isDailyDevotional = bmd.getBookCategory().equals(BookCategory.DAILY_DEVOTIONS);
 
         Calendar greg = new GregorianCalendar();
-        DateFormat nameDF = DateFormat.getDateInstance(DateFormat.MEDIUM);
+        DateFormatter nameDF = DateFormatter.getDateInstance();
 
         int entrysize = OFFSETSIZE + datasize;
         long entries;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDailyDevotion.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDailyDevotion.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDailyDevotion.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -19,9 +19,9 @@
 
 package org.crosswire.jsword.book.sword;
 
-import java.text.DateFormat;
 import java.util.Date;
 
+import org.crosswire.common.icu.DateFormatter;
 import org.crosswire.jsword.passage.Key;
 import org.crosswire.jsword.passage.PreferredKey;
 
@@ -47,6 +47,6 @@
      */
     public Key getPreferred()
     {
-        return new IndexKey(DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date()));
+        return new IndexKey(DateFormatter.getDateInstance().format(new Date()));
     }
 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java	2007-07-24 21:21:47 UTC (rev 1524)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ZLDBackend.java	2007-07-24 22:08:34 UTC (rev 1525)
@@ -24,13 +24,13 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 
 import org.crosswire.common.activate.Activator;
 import org.crosswire.common.activate.Lock;
 import org.crosswire.common.compress.CompressorType;
+import org.crosswire.common.icu.DateFormatter;
 import org.crosswire.common.util.ClassUtil;
 import org.crosswire.common.util.FileUtil;
 import org.crosswire.common.util.Logger;
@@ -207,7 +207,7 @@
         boolean isDailyDevotional = bmd.getBookCategory().equals(BookCategory.DAILY_DEVOTIONS);
 
         Calendar greg = new GregorianCalendar();
-        DateFormat nameDF = DateFormat.getDateInstance(DateFormat.MEDIUM);
+        DateFormatter nameDF = DateFormatter.getDateInstance();
 
         long entries;
         try




More information about the jsword-svn mailing list