[jsword-svn] r1993 - in trunk/biblemapper/src/main: java/org/crosswire/biblemapper/swing resources

dmsmith at crosswire.org dmsmith at crosswire.org
Sat Oct 23 13:20:56 MST 2010


Author: dmsmith
Date: 2010-10-23 13:20:56 -0700 (Sat, 23 Oct 2010)
New Revision: 1993

Modified:
   trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/BookChooser.java
   trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/ExtensionFileFilter.java
   trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java
   trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.properties
   trunk/biblemapper/src/main/resources/config.properties
Log:
remove NON-NLS comments

Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/BookChooser.java
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/BookChooser.java	2010-10-23 18:58:46 UTC (rev 1992)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/BookChooser.java	2010-10-23 20:20:56 UTC (rev 1993)
@@ -92,8 +92,7 @@
         });
 
         // I18N: migrate this to an ActionFactory
-        btnOk.setText(Msg.CHOOSER_OK.toString());
-        btnOk.setMnemonic(Msg.CHOOSER_OK.toString().charAt(0));
+        btnOk.setText(Msg.gettext("OK"));
         btnOk.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent ev) {
                 okPressed();
@@ -103,7 +102,7 @@
         btnOk.setDefaultCapable(true);
 
         // I18N: migrate this to an ActionFactory
-        btnCancel.setText(Msg.CHOOSER_CANCEL.toString());
+        btnCancel.setText(Msg.gettext("Cancel"));
         btnCancel.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent ev) {
                 cancelPressed();
@@ -223,7 +222,7 @@
     /**
      * The title of the dialog
      */
-    private String title = Msg.CHOOSER_TITLE.toString();
+    private String title = Msg.gettext("Select a Bible");
 
     /**
      * The Bible list model

Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/ExtensionFileFilter.java
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/ExtensionFileFilter.java	2010-10-23 18:58:46 UTC (rev 1992)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/ExtensionFileFilter.java	2010-10-23 20:20:56 UTC (rev 1993)
@@ -88,10 +88,10 @@
             return desc;
         }
 
-        StringBuffer buff = new StringBuffer("("); //$NON-NLS-1$
+        StringBuffer buff = new StringBuffer("(");
         for (int i = 0; i < extensions.length; i++) {
             if (i != 0) {
-                buff.append(", "); //$NON-NLS-1$
+                buff.append(", ");
             }
 
             buff.append(extensions[i]);
@@ -113,7 +113,7 @@
             return name.substring(idx + 1).toLowerCase();
         }
 
-        return ""; //$NON-NLS-1$
+        return "";
     }
 
     /**

Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java	2010-10-23 18:58:46 UTC (rev 1992)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java	2010-10-23 20:20:56 UTC (rev 1993)
@@ -31,16 +31,43 @@
  * @author Joe Walker [joe at eireneh dot com]
  */
 final class Msg extends MsgBase {
-    // I18N: migrate this to an ActionFactory
-    static final Msg CHOOSER_CANCEL = new Msg("BookChooser.Cancel"); //$NON-NLS-1$
-    // I18N: migrate this to an ActionFactory
-    static final Msg CHOOSER_OK = new Msg("BookChooser.OK"); //$NON-NLS-1$
-    static final Msg CHOOSER_TITLE = new Msg("BookChooser.Title"); //$NON-NLS-1$
 
     /**
-     * Passthrough ctor
+     * Get the internationalized text, but return key if key is unknown.
+     * 
+     * @param key
+     * @return the internationalized text
      */
-    private Msg(String name) {
-        super(name);
+    public static String gettext(String key)
+    {
+        return msg.lookup(key);
     }
+
+    /**
+     * Get the internationalized text, but return key if key is unknown.
+     * The text requires one parameter to be passed.
+     * 
+     * @param key
+     * @param param
+     * @return the formatted, internationalized text
+     */
+    public static String gettext(String key, Object param)
+    {
+        return msg.toString(key, param);
+    }
+
+    /**
+     * Get the internationalized text, but return key if key is unknown.
+     * The text requires one parameter to be passed.
+     * 
+     * @param key
+     * @param param
+     * @return the formatted, internationalized text
+     */
+    public static String gettext(String key, Object[] params)
+    {
+        return msg.toString(key, params);
+    }
+
+    private static MsgBase msg = new Msg();
 }

Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.properties
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.properties	2010-10-23 18:58:46 UTC (rev 1992)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.properties	2010-10-23 20:20:56 UTC (rev 1993)
@@ -1,10 +1,3 @@
-# The naming convention for the keys in the file is ClassName.MessageName
-# Where ClassName is the name of the class using the property.
-# When the resource is used by more than one class it should be the one
-# that the resource is most closely associated.
-# The MessageName should be mixed case, with a leading capital.
-# It should have no spaces or other punctuation (e.g. _, -, ', ...)
-
-BookChooser.Cancel=Cancel
-BookChooser.OK=OK
-BookChooser.Title=Select a Bible
+Cancel=Cancel
+OK=OK
+Select\ a\ Bible=Select a Bible

Modified: trunk/biblemapper/src/main/resources/config.properties
===================================================================
--- trunk/biblemapper/src/main/resources/config.properties	2010-10-23 18:58:46 UTC (rev 1992)
+++ trunk/biblemapper/src/main/resources/config.properties	2010-10-23 20:20:56 UTC (rev 1993)
@@ -1,7 +1,3 @@
-# The naming convention for the keys in the file is to match that of the
-# keys of the options in the config.xml file.
-# Since the keys may have spaces these need to be escaped here.
-
 Bibles.RetainCurrent.path=Bibles.Use Current Bible
 Bibles.RetainCurrent.help=New Bible Views use the last chosen Bible. Otherwise, use the default Bible.
 Bibles.DefaultBible.path=Bibles.Default Bible
@@ -48,7 +44,6 @@
 Passages.BlurringRules.help=What is the default expansion - Stay within chapter boundaries or not.
 Passages.BlurringRules.alternative.0=None
 Passages.BlurringRules.alternative.1=Chapter
-#Passages.BlurringRules.alternative.2=Book
 Passages.BookCase.path=Passages.Book Case
 Passages.BookCase.help=What case should we use to display the Bible book names.
 Passages.BookCase.alternative.0=lower
@@ -67,7 +62,6 @@
 Application.UIFont.path=Application.General Font
 Application.UIFont.help=The font for the application (Requires restart)
 
-# The following are not for general use and are hidden from view
 BibleDisplay.CSSOverride.path=Bible Display.CSS Override
 BibleDisplay.CSSOverride.help=Use an alternate CSS Stylesheet.
 BibleDisplay.Converter.path=Bible Display.Converter




More information about the jsword-svn mailing list