[jsword-svn] r1579 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop bibledesktop/src/main/resources common/src/main/java/org/crosswire/common/config common-swing/src/main/java/org/crosswire/common/config/swing jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/basic

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Sat Jul 28 19:52:00 MST 2007


Author: dmsmith
Date: 2007-07-28 19:52:00 -0700 (Sat, 28 Jul 2007)
New Revision: 1579

Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_fa.properties
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg_fa.properties
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Translations.java
   trunk/bibledesktop/src/main/resources/config.properties
   trunk/bibledesktop/src/main/resources/config.xml
   trunk/bibledesktop/src/main/resources/config_fa.properties
   trunk/bibledesktop/src/main/resources/config_fa.txt
   trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java
   trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java
   trunk/common/src/main/java/org/crosswire/common/config/MappedOptionsChoice.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
Log:
More i18n farsi work.
Now it is possible to switch between English and Farsi and have the saved options work.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -1119,6 +1119,9 @@
         /* @Override */
         public void run()
         {
+            // The first thing that has to be done is to set the locale.
+            Translations.instance().setLocale();
+
             // These Mac properties give the application a Mac behavior
             if (OSType.MAC.equals(OSType.getOSType()))
             {
@@ -1127,9 +1130,6 @@
                 System.setProperty("com.apple.mrj.application.live-resize", "true"); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-            // The first thing that has to be done is to set the locale.
-            Translations.instance().setLocale();
-
 //            new BusStart();
             ExceptionPane.setHelpDeskListener(true);
             LookAndFeelUtil.initialize();

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_fa.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_fa.properties	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_fa.properties	2007-07-29 02:52:00 UTC (rev 1579)
@@ -165,7 +165,7 @@
 
 Back.Name=\u0639\u0642\u0628 
 Back.ShortDescription=\u0639\u0642\u0628 \u0631\u0627\u0647 \u062D\u0646\u0631\u0627\u0632\u06CC
-Back.LongDescription\u0639\u0642\u0628 \u0628\u0647 \u0628\u062E\u0634\u0647 \u0642\u0628\u0644\u06CC =\u0631\u0627\u0647 \u062D\u0646\u0631\u0627\u0632\u06CC.
+Back.LongDescription=\u0639\u0642\u0628 \u0628\u0647 \u0628\u062E\u0634\u0647 \u0642\u0628\u0644\u06CC =\u0631\u0627\u0647 \u062D\u0646\u0631\u0627\u0632\u06CC.
 Back.MnemonicKey=
 # KeyEvent.VK_LEFT
 Back.AcceleratorKey=0x25

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg_fa.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg_fa.properties	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg_fa.properties	2007-07-29 02:52:00 UTC (rev 1579)
@@ -16,12 +16,12 @@
 Desktop.ConfigFileFailed=\u0646\u0645\u06CC \u062A\u0648\u0627\u0646\u0633\u062A \u0641\u0627\u06CC\u0644 \u067E\u06CC\u06A9\u0631\u0628\u0646\u062F\u06CC \u0630\u062E\u06CC\u0631\u0647 \u0628\u0646\u0645\u0627\u06CC\u062F {0}
 
 # Properties used by Desktop for hyperlinks
-Desktop.UnknownProtocol=\u067E\u0631\u0648\u062A\u06A9\u0644 \u0646\u0627\u0634\u0646\u0627\u062E\u062A\u0647 {0}
+#Desktop.UnknownProtocol=\u067E\u0631\u0648\u062A\u06A9\u0644 \u0646\u0627\u0634\u0646\u0627\u062E\u062A\u0647 {0}
 #Desktop.BadProtocolUrl=\u06AF\u0645 \u0634\u062F\u0647 \u062F\u0631 {0}
 
 
 # Properties for the startup job
-Desktop.StartupTitle=\u0634\u0631\u0648
+#Desktop.StartupTitle=\u0634\u0631\u0648
 #Desktop.StartupConfig=\u0634\u0631\u0648\u06CC \u067E\u06CC\u06A9\u0627\u0631\u0628\u0627\u0646\u062F\u06CC
 Desktop.StartupGenerate=\u067E\u06CC\u06A9\u0627\u0631\u0628\u0627\u0646\u062F\u06CC \u0627\u0633\u0628\u0627\u0628\u0647\u0627
 Desktop.StartupGeneral=\u067E\u06CC\u06A9\u0627\u0631\u0628\u0646\u062F\u06CC \u0627\u0648\u0645\u0648\u0645\u06CC
@@ -34,7 +34,7 @@
 DesktopActions.NoHelp=\u0647\u0645\u06CC\u0646\u0627\u0644\u0627\u0646 \u06A9\u0645\u06A9 \u0641\u0642\u062F \u062A\u0648\u06CC \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0648\u062C\u0648\u062F \u062F\u0631\u062F:\nhttp://www.crosswire.org/bibledesktop
 #DesktopActions.NotImplemented=\u0647\u0646\u0648\u0632 \u0648\u062C\u0648\u062F \u0646\u062F\u0631\u062F{0}
 DesktopActions.NoPassage=\u0647\u06CC\u062C \u0628\u0631\u0627\u06CC \u0627\u0646\u0628\u0627\u0631 \u06A9\u0631\u062F\u0646 \u0627\u0646\u062A\u062D\u0627\u0628 \u0646\u06A9\u0631\u062F\u06CC\u062F
-DesktopActions.SourceMissing=هیج عنتحاب وجود دارد
+DesktopActions.SourceMissing=\u0647\u06CC\u062C \u0639\u0646\u062A\u062D\u0627\u0628 \u0648\u062C\u0648\u062F \u062F\u0627\u0631\u062F
 
 # Properties for AboutPane and Splash
 # The splash image should be localized
@@ -44,10 +44,10 @@
 AboutPane.Details=\u0644\u06CC\u0632\u0627\u0646\u0632
 
 # the next 4 are not implemented at this time
-AboutPane.ErrorTabTitle=\u0627\u0634\u062A\u0628\u0627\u0647\u0627
-AboutPane.TaskTabTitle=Running Tasks
-AboutPane.SystemPropsTabTitle=System Properties
-AboutPane.DebugTabTitle=Debug
+#AboutPane.ErrorTabTitle=\u0627\u0634\u062A\u0628\u0627\u0647\u0627
+#AboutPane.TaskTabTitle=Running Tasks
+#AboutPane.SystemPropsTabTitle=System Properties
+#AboutPane.DebugTabTitle=Debug
 
 # Properties for StatusBar
 StatusBar.StatusDefault=\u0647\u0627\u0632\u0631...
@@ -64,32 +64,31 @@
 
 # not implemented at this time
 # Properties for ComparePane
-ComparePane.Dialog=\u0645\u0642\u0627\u06CC\u0633\u0647 \u06A9\u0631\u062F\u0646 
-ComparePane.IdentQuestion=\u0627\u06CC\u0627 \u0634\u0645\u0627\u0645\u06CC\u062E\u0648\u0627\u0647\u06CC\u062F \u062F\u0648\u0628\u0631 \u0647\u0645\u0627\u0646 \u06A9\u062A\u0627\u0628\u0647\u0627 \u0645\u0642\u0627\u06CC\u0633\u0647\u06A9\u0646\u06CC\u062F\u061F
-ComparePane.IdentTitle=Compare Identical Books?
-ComparePane.Words=\u06A9\u0644\u0645\u0627\u062A
-ComparePane.Go=\u0645\u0642\u0627\u06CC\u0633\u0647 \u06A9\u0631\u062F\u0646
-ComparePane.Using=\u0645\u0642\u0627\u06CC\u0633\u0647 \u0628\u06A9\u0646 \u0628\u0627
-ComparePane.WordsTip=[empty] - test no words; * - test all words, text - test all words starting with ''text''
-ComparePane.Title=\u06A9\u062A\u0627\u0628\u0647\u0627 \u0628\u0631\u0627\u06CC \u0645\u0642\u0627\u06CC\u0633\u0647
-ComparePane.Verses=\u0639\u06CC\u0627\u062A
+#ComparePane.Dialog=\u0645\u0642\u0627\u06CC\u0633\u0647 \u06A9\u0631\u062F\u0646 
+#ComparePane.IdentQuestion=\u0627\u06CC\u0627 \u0634\u0645\u0627\u0645\u06CC\u062E\u0648\u0627\u0647\u06CC\u062F \u062F\u0648\u0628\u0631 \u0647\u0645\u0627\u0646 \u06A9\u062A\u0627\u0628\u0647\u0627 \u0645\u0642\u0627\u06CC\u0633\u0647\u06A9\u0646\u06CC\u062F\u061F
+#ComparePane.IdentTitle=Compare Identical Books?
+#ComparePane.Words=\u06A9\u0644\u0645\u0627\u062A
+#ComparePane.Go=\u0645\u0642\u0627\u06CC\u0633\u0647 \u06A9\u0631\u062F\u0646
+#ComparePane.Using=\u0645\u0642\u0627\u06CC\u0633\u0647 \u0628\u06A9\u0646 \u0628\u0627
+#ComparePane.WordsTip=[empty] - test no words; * - test all words, text - test all words starting with ''text''
+#ComparePane.Title=\u06A9\u062A\u0627\u0628\u0647\u0627 \u0628\u0631\u0627\u06CC \u0645\u0642\u0627\u06CC\u0633\u0647
+#ComparePane.Verses=\u0639\u06CC\u0627\u062A
 
 # not implemented at this time
 # Properties for CompareResultsPane
-CompareResultsPane.Title=\u0646\u062A\u06CC\u0686\u0647
-CompareResultsPane.Start=\u0634\u0631\u0648
-CompareResultsPane.Close=\u0628\u0628\u0646\u062F
-CompareResultsPane.Dialog=\u0627\u0633\u0645\u0627\u06CC\u0634 \u0646\u062A\u06CC\u062C\u0647\u0647\u0627
-CompareResultsPane.Books=\u06A9\u062A\u0627\u0628\u0647\u0627:
-CompareResultsPane.Comparing=\u0645\u0642\u0627\u06CC\u0633\u0647:
-CompareResultsPane.Passage=\u0642\u0633\u0645\u062A
-CompareResultsPane.Words=\u06A9\u0644\u0645
-CompareResultsPane.Stop=\u0627\u06CC\u0633\u062A!
+#CompareResultsPane.Title=\u0646\u062A\u06CC\u0686\u0647
+#CompareResultsPane.Start=\u0634\u0631\u0648
+#CompareResultsPane.Close=\u0628\u0628\u0646\u062F
+#CompareResultsPane.Dialog=\u0627\u0633\u0645\u0627\u06CC\u0634 \u0646\u062A\u06CC\u062C\u0647\u0647\u0627
+#CompareResultsPane.Books=\u06A9\u062A\u0627\u0628\u0647\u0627:
+#CompareResultsPane.Comparing=\u0645\u0642\u0627\u06CC\u0633\u0647:
+#CompareResultsPane.Passage=\u0642\u0633\u0645\u062A
+#CompareResultsPane.Words=\u06A9\u0644\u0645
+#CompareResultsPane.Stop=\u0627\u06CC\u0633\u062A!
 
 # not implemented at this time
 # Properties for DebugPane
-DebugPane.Steps= {0}/{1}
-DebugPane.Views=\u0646\u0645\u0627\u0647\u0627
-DebugPane.Go=\u0628\u0631\u0648
-DebugPane.Method=\u0631\u0648\u0634:
- 
+#DebugPane.Steps= {0}/{1}
+#DebugPane.Views=\u0646\u0645\u0627\u0647\u0627
+#DebugPane.Go=\u0628\u0631\u0648
+#DebugPane.Method=\u0631\u0648\u0634:

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Translations.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Translations.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Translations.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -23,9 +23,9 @@
 
 import java.io.IOException;
 import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.LinkedHashMap;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Properties;
 
 import org.crosswire.common.config.ChoiceFactory;
@@ -75,16 +75,16 @@
      * 
      * @return an string array of translations in locale friendly names.
      */
-    public String[] getSupported()
+    public Map getSupported()
     {
-        List names = new ArrayList();
+        Map names = new LinkedHashMap();
 
         for (int i = 0; i < translations.length; i++)
         {
-            names.add(Languages.getLanguage(translations[i]));
+            names.put(translations[i], Languages.getLanguage(translations[i]));
         }
 
-        return (String[]) names.toArray(new String[names.size()]);
+        return names;
     }
 
     /**
@@ -117,10 +117,12 @@
         String currentLang = ""; //$NON-NLS-1$
         for (int i = 0; i < translations.length; i++)
         {
-            currentLang = Languages.getLanguage(translations[i]);
-            if (currentLang.equals(newTranslation))
+            String trans = translations[i];
+            currentLang = Languages.getLanguage(translation);
+            if (trans.equals(newTranslation) || currentLang.equals(newTranslation))
             {
-                lang = translations[i];
+                lang = trans;
+                break;
             }
         }
 
@@ -186,7 +188,7 @@
      * 
      * @return an string array of translations in locale friendly names.
      */
-    public static String[] getSupportedTranslations()
+    public static Map getSupportedTranslations()
     {
         return Translations.instance().getSupported();
     }

Modified: trunk/bibledesktop/src/main/resources/config.properties
===================================================================
--- trunk/bibledesktop/src/main/resources/config.properties	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/resources/config.properties	2007-07-29 02:52:00 UTC (rev 1579)
@@ -85,7 +85,7 @@
 BibleDisplay.Converter.hidden=true
 BibleDisplay.Converter.name=Converter
 BibleDisplay.Converter.help=The engine used to generate the book display
-BibleDisplay.ConfigurableStylesheet.hidden=false
+BibleDisplay.ConfigurableStylesheet.hidden=true
 BibleDisplay.ConfigurableStylesheet.name=Configurable Stylesheet
 BibleDisplay.ConfigurableStylesheet.help=The style applied to displayed Books when using the configurable styler.
 Application.LookAndFeel.hidden=true

Modified: trunk/bibledesktop/src/main/resources/config.xml
===================================================================
--- trunk/bibledesktop/src/main/resources/config.xml	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/resources/config.xml	2007-07-29 02:52:00 UTC (rev 1579)
@@ -66,46 +66,46 @@
     <introspect class="org.crosswire.jsword.book.Defaults" property="CurrentBible"/>
   </option>
 
-  <option key="Bibles.DefaultBible" type="string-options">
+  <option key="Bibles.DefaultBible" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="BibleByName"/>
     <map name="bible-names"/>
     <!-- set up in OptionsAction.refreshBooks() along with dict and commentary versions -->
   </option>
 
-  <option key="Bibles.DefaultDailyDevotional" type="string-options">
+  <option key="Bibles.DefaultDailyDevotional" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="DailyDevotionalByName"/>
     <map name="daily-devotional-names"/>
   </option>
 
 <!-- Does not mean anything right now -->
-  <option key="Bibles.DefaultDictionary" type="string-options">
+  <option key="Bibles.DefaultDictionary" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="DictionaryByName"/>
     <map name="dictionary-names"/>
   </option>
 
 <!-- Does not mean anything right now -->
-  <option key="Bibles.DefaultCommentary" type="string-options">
+  <option key="Bibles.DefaultCommentary" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="CommentaryByName"/>
     <map name="commentary-names"/>
   </option>
 
-  <option key="Bibles.DefaultGreekDefinitions" type="string-options">
+  <option key="Bibles.DefaultGreekDefinitions" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="GreekDefinitionsByName"/>
     <map name="greekdef-names"/>
   </option>
 
-  <option key="Bibles.DefaultHebrewDefinitions" type="string-options">
+  <option key="Bibles.DefaultHebrewDefinitions" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="HebrewDefinitionsByName"/>
     <map name="hebrewdef-names"/>
   </option>
 
-  <option key="Bibles.DefaultGreekParse" type="string-options">
+  <option key="Bibles.DefaultGreekParse" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="GreekParseByName"/>
     <map name="greekparse-names"/>
   </option>
 
 <!-- There are no Hebrew parsing guides at this time. -->
-  <option key="Bibles.DefaultHebrewParse" type="string-options">
+  <option key="Bibles.DefaultHebrewParse" type="map-options">
     <introspect class="org.crosswire.jsword.book.Defaults" property="HebrewParseByName"/>
     <map name="hebrewparse-names"/>
   </option>
@@ -200,7 +200,7 @@
     <introspect class="org.crosswire.common.swing.LookAndFeelUtil" property="LookAndFeel"/>
   </option>
 
-  <option key="Application.Language" type="string-options">
+  <option key="Application.Language" type="map-options">
     <introspect class="org.crosswire.bibledesktop.desktop.Translations" property="CurrentTranslation"/>
     <map name="translation-codes"/>
   </option>

Modified: trunk/bibledesktop/src/main/resources/config_fa.properties
===================================================================
--- trunk/bibledesktop/src/main/resources/config_fa.properties	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/resources/config_fa.properties	2007-07-29 02:52:00 UTC (rev 1579)
@@ -58,12 +58,11 @@
 Passages.PersistentNaming.help=
 Passages.FullBookName.name=\u0639\u0633\u0645 \u06A9\u062A\u0627\u0628\u0647\u0627 \u06A9\u0627\u0645\u0644
 Passages.FullBookName.help=
-Passages.BlurringRules.ignore=true
-#Passages.BlurringRules.name=\u062C\u0642\u062F\u0631 \u062F\u0631 \u0647\u0631 \u0635\u0641\u0647
-#Passages.BlurringRules.help=\u0628\u06CC\u0634\u062A\u0631 \u0627\u0633 \u06CC\u06A9 \u0628\u0627\u0628 \u062F\u0631 \u0647\u0631 \u0635\u0641\u0647\u061F
-#Passages.BlurringRules.alternative.0=\u0647\u06CC\u062C
-#Passages.BlurringRules.alternative.1=\u0628\u0627\u0628
-##Passages.BlurringRules.alternative.2=\u06A9\u062A\u0627\u0628
+Passages.BlurringRules.name=\u062C\u0642\u062F\u0631 \u062F\u0631 \u0647\u0631 \u0635\u0641\u0647
+Passages.BlurringRules.help=\u0628\u06CC\u0634\u062A\u0631 \u0627\u0633 \u06CC\u06A9 \u0628\u0627\u0628 \u062F\u0631 \u0647\u0631 \u0635\u0641\u0647\u061F
+Passages.BlurringRules.alternative.0=\u0647\u06CC\u062C
+Passages.BlurringRules.alternative.1=\u0628\u0627\u0628
+#Passages.BlurringRules.alternative.2=\u06A9\u062A\u0627\u0628
 
 # The BookCase option is relevant only for scripts with upper case. I have therefore taken them out. I also do not know exactly how to translate them anyway...
 Passages.BookCase.ignore=true
@@ -71,11 +70,10 @@
 Application.name=\u0628\u0631\u0646\u0627\u0645\u0647
 Application.Language.name=\u0632\u0628\u0627\u0646
 Application.Language.help=\u0634\u0631\u0648\u0639 \u062A\u0627\u0632\u0647 \u0644\u0632\u0645 \u0647\u0633\u062A
-Application.InitialLayout.ignore=true
-#Application.InitialLayout.name=\u062A\u0631\u062A\u06CC\u0628
-#Application.InitialLayout.help=\u0646\u0645\u0627\u06CC\u0634 \u0628\u0627 \u067E\u0646\u062C\u0631\u0647\u0647\u0627 \u06CC\u0627 \u0628\u0627 \u062C\u062F\u0648\u0644 \u0628\u0646\u062F
-#Application.InitialLayout.alternative.0=\u062C\u062F\u0648\u0644 \u0628\u0646\u062F
-#Application.InitialLayout.alternative.1=\u067E\u0646\u062C\u0631\u0647\u0647\u0627
+Application.InitialLayout.name=\u062A\u0631\u062A\u06CC\u0628
+Application.InitialLayout.help=\u0646\u0645\u0627\u06CC\u0634 \u0628\u0627 \u067E\u0646\u062C\u0631\u0647\u0647\u0627 \u06CC\u0627 \u0628\u0627 \u062C\u062F\u0648\u0644 \u0628\u0646\u062F
+Application.InitialLayout.alternative.0=\u062C\u062F\u0648\u0644 \u0628\u0646\u062F
+Application.InitialLayout.alternative.1=\u067E\u0646\u062C\u0631\u0647\u0647\u0627
 Application.MaxHeight.name=\u0628\u0644\u0646\u062F\u06CC \u067E\u0646\u062C\u0631\u0647
 Application.MaxHeight.help=
 Application.MaxWidth.name=\u067E\u0647\u0646\u0627 \u067E\u0646\u062C\u0631\u0647

Modified: trunk/bibledesktop/src/main/resources/config_fa.txt
===================================================================
--- trunk/bibledesktop/src/main/resources/config_fa.txt	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/bibledesktop/src/main/resources/config_fa.txt	2007-07-29 02:52:00 UTC (rev 1579)
@@ -57,12 +57,11 @@
 Passages.PersistentNaming.help=
 Passages.FullBookName.name=عسم کتابها کامل
 Passages.FullBookName.help=
-Passages.BlurringRules.ignore=true
-#Passages.BlurringRules.name=جقدر در هر صفه
-#Passages.BlurringRules.help=بیشتر اس یک باب در هر صفه؟
-#Passages.BlurringRules.alternative.0=هیج
-#Passages.BlurringRules.alternative.1=باب
-##Passages.BlurringRules.alternative.2=کتاب
+Passages.BlurringRules.name=جقدر در هر صفه
+Passages.BlurringRules.help=بیشتر اس یک باب در هر صفه؟
+Passages.BlurringRules.alternative.0=هیج
+Passages.BlurringRules.alternative.1=باب
+#Passages.BlurringRules.alternative.2=کتاب
 
 # The BookCase option is relevant only for scripts with upper case. I have therefore taken them out. I also do not know exactly how to translate them anyway...
 
@@ -71,11 +70,10 @@
 Application.name=برنامه
 Application.Language.name=زبان
 Application.Language.help=شروع تازه لزم هست
-Application.InitialLayout.ignore=true
-#Application.InitialLayout.name=ترتیب
-#Application.InitialLayout.help=نمایش با پنجرهها یا با جدول بند
-#Application.InitialLayout.alternative.0=جدول بند
-#Application.InitialLayout.alternative.1=پنجرهها
+Application.InitialLayout.name=ترتیب
+Application.InitialLayout.help=نمایش با پنجرهها یا با جدول بند
+Application.InitialLayout.alternative.0=جدول بند
+Application.InitialLayout.alternative.1=پنجرهها
 Application.MaxHeight.name=بلندی پنجره
 Application.MaxHeight.help=
 Application.MaxWidth.name=پهنا پنجره

Modified: trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -283,7 +283,7 @@
         try
         {
             Object object = convertToObject(value);
-            setter.invoke(null, new Object[] { object });
+            setter.invoke(null, new Object[] { object.toString() });
         }
         catch (InvocationTargetException e)
         {

Modified: trunk/common/src/main/java/org/crosswire/common/config/MappedOptionsChoice.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/config/MappedOptionsChoice.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/common/src/main/java/org/crosswire/common/config/MappedOptionsChoice.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -88,7 +88,7 @@
     /* @Override */
     public String convertToString(Object orig)
     {
-        return orig.toString();
+        return orig != null ? orig.toString() : ""; //$NON-NLS-1$
     }
 
     /* (non-Javadoc)
@@ -98,10 +98,11 @@
     public Object convertToObject(String orig)
     {
         Iterator iter = options.entrySet().iterator();
+        Map.Entry mapEntry = null;
         while (iter.hasNext())
         {
-            Map.Entry mapEntry = (Map.Entry) iter.next();
-            if (mapEntry.getValue().equals(orig))
+            mapEntry = (Map.Entry) iter.next();
+            if (mapEntry.getValue().toString().equals(orig) || mapEntry.getKey().toString().equals(orig))
             {
                 return mapEntry.getKey();
             }

Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -104,7 +104,7 @@
             if (match instanceof Map.Entry)
             {
                 Map.Entry mapEntry = (Map.Entry) match;
-                if (mapEntry.getKey().toString().equals(value))
+                if (mapEntry.getKey().toString().equals(value) || mapEntry.getValue().toString().equals(value))
                 {
                     combo.setSelectedItem(mapEntry);
                     return;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -119,7 +119,7 @@
      * Book objects.
      * <p>This method is picky in that it only matches when the driver and the
      * version are the same. The user (probably) only cares about the version
-     * though, and so might be dissapointed when we fail to match AV (FooDriver)
+     * though, and so might be disappointed when we fail to match AV (FooDriver)
      * against AV (BarDriver).
      * @param name The version to use as default.
      */

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -24,6 +24,8 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
 
 import org.crosswire.common.config.ChoiceFactory;
 
@@ -449,35 +451,35 @@
     public static void refreshBooks()
     {
         // Create the array of Bibles
-        String[] bnames = getNameArray(BookFilters.getOnlyBibles());
+        Map bnames = getBookMap(BookFilters.getOnlyBibles());
         ChoiceFactory.getDataMap().put(BIBLE_KEY, bnames);
 
         // Create the array of Commentaries
-        String[] cnames = getNameArray(BookFilters.getCommentaries());
+        Map cnames = getBookMap(BookFilters.getCommentaries());
         ChoiceFactory.getDataMap().put(COMMENTARY_KEY, cnames);
 
         // Create the array of Dictionaries
-        String[] dnames = getNameArray(BookFilters.getDictionaries());
+        Map dnames = getBookMap(BookFilters.getDictionaries());
         ChoiceFactory.getDataMap().put(DICTIONARY_KEY, dnames);
 
         // Create the array of DailyDevotionals
-        String[] rnames = getNameArray(BookFilters.getDailyDevotionals());
+        Map rnames = getBookMap(BookFilters.getDailyDevotionals());
         ChoiceFactory.getDataMap().put(DAILY_DEVOTIONALS_KEY, rnames);
 
         // Create the array of Dictionaries
-        String[] greekDef = getNameArray(BookFilters.getGreekDefinitions());
+        Map greekDef = getBookMap(BookFilters.getGreekDefinitions());
         ChoiceFactory.getDataMap().put(GREEKDEF_KEY, greekDef);
 
         // Create the array of Dictionaries
-        String[] hebrewDef = getNameArray(BookFilters.getHebrewDefinitions());
+        Map hebrewDef = getBookMap(BookFilters.getHebrewDefinitions());
         ChoiceFactory.getDataMap().put(HEBREWDEF_KEY, hebrewDef);
 
         // Create the array of Dictionaries
-        String[] greekParse = getNameArray(BookFilters.getGreekParse());
+        Map greekParse = getBookMap(BookFilters.getGreekParse());
         ChoiceFactory.getDataMap().put(GREEKPARSE_KEY, greekParse);
 
         // Create the array of Dictionaries
-        String[] hebrewParse = getNameArray(BookFilters.getHebrewParse());
+        Map hebrewParse = getBookMap(BookFilters.getHebrewParse());
         ChoiceFactory.getDataMap().put(HEBREWPARSE_KEY, hebrewParse);
     }
 
@@ -516,18 +518,18 @@
     /**
      * Convert a filter into an array of names of Books that pass the filter.
      */
-    private static String[] getNameArray(BookFilter filter)
+    private static Map getBookMap(BookFilter filter)
     {
-        List names = new ArrayList();
+        Map books = new TreeMap(BookComparators.getDefault());
 
         Iterator iter = Books.installed().getBooks(filter).iterator();
         while (iter.hasNext())
         {
             Book book = (Book) iter.next();
-            names.add(book.getName());
+            books.put(book, book.getName());
         }
 
-        return (String[]) names.toArray(new String[names.size()]);
+        return books;
     }
 
     /**

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java	2007-07-29 00:49:34 UTC (rev 1578)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java	2007-07-29 02:52:00 UTC (rev 1579)
@@ -311,7 +311,7 @@
      */
     public String toString()
     {
-        return getName();
+        return getInitials();
     }
 
     /**




More information about the jsword-svn mailing list