[jsword-svn] r2104 - in trunk/common-swing/src/main/java/org/crosswire/common: config/swing swing swing/desktop
dmsmith at crosswire.org
dmsmith at crosswire.org
Mon Mar 7 11:54:35 MST 2011
Author: dmsmith
Date: 2011-03-07 11:54:34 -0700 (Mon, 07 Mar 2011)
New Revision: 2104
Modified:
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/BooleanField.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ButtonPane.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FileField.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/PathField.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/StringArrayField.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/QuickHelpDialog.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java
Log:
BD-156 Added translator instructions to strings in common-swing
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/BooleanField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/BooleanField.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/BooleanField.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -47,7 +47,9 @@
public BooleanField() {
ActionFactory actions = new ActionFactory(this);
+ // TRANSLATOR: This is the text on a "Yes" button
on = new JRadioButton(actions.addAction("Yes", CWMsg.gettext("Yes")));
+ // TRANSLATOR: This is the text on a "No" button
off = new JRadioButton(actions.addAction("No", CWMsg.gettext("No")));
ButtonGroup group = new ButtonGroup();
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ButtonPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ButtonPane.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ButtonPane.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -65,8 +65,11 @@
buttons.setLayout(new GridLayout(1, 2, 10, 10));
buttons.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
+ // TRANSLATOR: This is the text on an "OK" button
buttons.add(new JButton(actions.addAction("OK", CWMsg.gettext("OK"))));
+ // TRANSLATOR: This is the text on a "Cancel" button
buttons.add(new JButton(actions.addAction("Cancel", CWMsg.gettext("Cancel"))));
+ // TRANSLATOR: This is the text on an "Apply" button
buttons.add(new JButton(actions.addAction("Apply", CWMsg.gettext("Apply"))));
this.setBorder(new EdgeBorder(SwingConstants.NORTH));
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FileField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FileField.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FileField.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -31,6 +31,7 @@
import org.crosswire.common.config.Choice;
import org.crosswire.common.swing.ActionFactory;
+import org.crosswire.common.swing.CWAction;
import org.crosswire.common.swing.CWMsg;
/**
@@ -51,7 +52,11 @@
setLayout(new BorderLayout(10, 0));
add(text, BorderLayout.CENTER);
- add(new JButton(actions.addAction("Browse", CWMsg.gettext("Browse")).setTooltip(CWMsg.gettext("Browse for a directory to select."))), BorderLayout.LINE_END);
+ // TRANSLATOR: This is the text on a "Browse" button, that brings up a file selection dialog.
+ CWAction action = actions.addAction("Browse", CWMsg.gettext("Browse"));
+ // TRANSLATOR: This is the tooltip for a "Browse" button, that brings up a file selection dialog.
+ action.setTooltip(CWMsg.gettext("Browse for a directory to select."));
+ add(new JButton(action), BorderLayout.LINE_END);
}
/**
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/PathField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/PathField.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/PathField.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -71,8 +71,13 @@
JScrollPane scroll = new CWScrollPane(list);
+ // TRANSLATOR: This is the text on an "Add" button.
buttons.add(new JButton(actions.addAction("Add", CWMsg.gettext("Add"))));
+ // TRANSLATOR: This is the text on a "Remove" button.
buttons.add(new JButton(actions.addAction("Remove", CWMsg.gettext("Remove"))));
+ // TRANSLATOR: This is the text on an "Update" button for a path
+ // Note: The " (path)" is not to be translated.
+ // It is here because some languages translate "Update" differently depending on context.
buttons.add(new JButton(actions.addAction("Update", CWMsg.gettext("Update (path)"))));
setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5, 5, 5, 5)));
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/StringArrayField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/StringArrayField.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/StringArrayField.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -78,8 +78,11 @@
JScrollPane scroll = new CWScrollPane(list);
+ // TRANSLATOR: This is the text on an "Add" button.
buttons.add(new JButton(actions.addAction("Add", CWMsg.gettext("Add"))));
+ // TRANSLATOR: This is the text on a "Remove" button.
buttons.add(new JButton(actions.addAction("Remove", CWMsg.gettext("Remove"))));
+ // TRANSLATOR: This is the text on an "Update" button.
buttons.add(new JButton(actions.addAction("Update", CWMsg.gettext("Update"))));
Border title = BorderFactory.createTitledBorder(CWOtherMsg.lookupText("Component Editor"));
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -780,9 +780,13 @@
*/
private static ActionFactory actions = new ActionFactory(null);
static {
+ // TRANSLATOR: This is the text on a "Yes" button.
actions.addAction("Yes", CWMsg.gettext("Yes"));
+ // TRANSLATOR: This is the text on a "No" button.
actions.addAction("No", CWMsg.gettext("No"));
+ // TRANSLATOR: This is the text on an "OK" button.
actions.addAction("OK", CWMsg.gettext("OK"));
+ // TRANSLATOR: This is the text on a "Cancel" button.
actions.addAction("Cancel", CWMsg.gettext("Cancel"));
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -227,6 +227,7 @@
final ActionFactory actions = new ActionFactory(pane);
+ // TRANSLATOR: This is the text on an "OK" button.
JButton ok = actions.createJButton(actions.addAction("OK", CWMsg.gettext("OK")), new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
@@ -307,28 +308,13 @@
// The message in the exception
String msg = ex.getMessage();
if (msg == null || msg.equals("")) {
- // I18N(DMS)
+ // TRANSLATOR: When an error dialog is presented to the user, this is shown when
+ // there is no other message available
msg = CWMsg.gettext("No description available.");
}
String orig = XMLUtil.escape(msg);
msg = orig.replaceAll("\n", "<br>");
- // The name of the exception
- /*
- * String classname = ex.getClass().getName(); int lastdot =
- * classname.lastIndexOf('.'); if (lastdot != -1) classname =
- * classname.substring(lastdot+1); if (classname.endsWith("Exception")
- * && classname.length() > "Exception".length()) classname =
- * classname.substring(0, classname.length() - "Exception".length()); if
- * (classname.endsWith("Error") && classname.length() >
- * "Error".length()) classname = classname.substring(0,
- * classname.length() - "Error".length()); classname =
- * StringUtil.createTitle(classname); if (classname.equals("IO"))
- * classname = "Input / Output";
- *
- * retcode.append("<font size=\"-1\"><strong>");
- * retcode.append(classname); retcode.append("</strong></font>");
- */
retcode.append("<br>");
retcode.append(msg);
@@ -356,12 +342,8 @@
pane = ep;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent
- * )
+ /* (non-Javadoc)
+ * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
*/
public void itemStateChanged(ItemEvent ev) {
pane.changeDetail();
@@ -383,12 +365,8 @@
traces = cb;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent
- * )
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent ev) {
Throwable th = (Throwable) traces.getSelectedItem();
@@ -421,12 +399,8 @@
this.mylabel = label;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * javax.swing.event.ListSelectionListener#valueChanged(javax.swing.
- * event.ListSelectionEvent)
+ /* (non-Javadoc)
+ * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
*/
public void valueChanged(ListSelectionEvent ev) {
if (ev.getValueIsAdjusting()) {
@@ -551,7 +525,7 @@
* The event describing the Exception
*/
public void reportException(ReporterEvent ev) {
- // This faf is to ensure that we don't break any SwingThread rules
+ // This is to ensure that we don't break any SwingThread rules
SwingUtilities.invokeLater(new ExceptionRunner(ev));
}
@@ -562,7 +536,7 @@
* The event describing the message
*/
public void reportMessage(ReporterEvent ev) {
- // This faf is to ensure that we don't break any SwingThread rules
+ // This is to ensure that we don't break any SwingThread rules
SwingUtilities.invokeLater(new MessageRunner(ev));
}
}
@@ -605,9 +579,7 @@
event = ev;
}
- /*
- * (non-Javadoc)
- *
+ /* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
public void run() {
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -118,12 +118,14 @@
final ActionFactory actions = new ActionFactory(fontc);
+ // TRANSLATOR: This is the text on an "OK" button.
JButton ok = actions.createJButton(actions.addAction("OK", CWMsg.gettext("OK")), new ActionListener() {
public void actionPerformed(ActionEvent e) {
fontc.dialog.dispose();
}
});
+ // TRANSLATOR: This is the text on a "Cancel" button.
JButton cancel = actions.createJButton(actions.addAction("Cancel", CWMsg.gettext("Cancel")), new ActionListener() {
public void actionPerformed(ActionEvent ex) {
fontc.dialog.setVisible(false);
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/QuickHelpDialog.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/QuickHelpDialog.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/QuickHelpDialog.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -83,6 +83,7 @@
JScrollPane scrHelp = new CWScrollPane(txtHelp);
scrHelp.setBorder(null);
+ // TRANSLATOR: This is the text on an "Add" button.
JButton btnOK = new JButton(actions.addAction("Add", CWMsg.gettext("Add")));
JPanel pnlOK = new JPanel();
pnlOK.setLayout(new FlowLayout(FlowLayout.TRAILING));
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ToolBar.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -170,7 +170,12 @@
* toolbar
*/
public JMenuItem getShowToggle() {
- JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(actions.addAction("ToolBarToggle", CWMsg.gettext("Show Tool Bar")).setTooltip(CWMsg.gettext("Toggle the display of the tool bar")).setAccelerator("B,ctrl"));
+ // TRANSLATOR: This is the label of a view option allowing a user to show/hide the tool bar
+ CWAction action = actions.addAction("ToolBarToggle", CWMsg.gettext("Show Tool Bar"));
+ // TRANSLATOR: This is the tooltip for a view option allowing a user to show/hide the tool bar
+ action.setTooltip(CWMsg.gettext("Toggle the display of the tool bar"));
+ action.setAccelerator("B,ctrl");
+ JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(action);
toggle.setSelected(true);
return toggle;
}
@@ -181,7 +186,11 @@
* @return a check box that can be used to toggle the text
*/
public JMenuItem getTextToggle() {
- return new JCheckBoxMenuItem(actions.addAction("ToolBarText", CWMsg.gettext("Show Tool Bar Text")).setTooltip(CWMsg.gettext("Toggle the display of the tool bar text")));
+ // TRANSLATOR: This is the label of a view option allowing a user to show/hide the text for icons on the tool bar
+ CWAction action = actions.addAction("ToolBarText", CWMsg.gettext("Show Tool Bar Text"));
+ // TRANSLATOR: This is the tooltip for a view option allowing a user to show/hide the text for icons on the tool bar
+ action.setTooltip(CWMsg.gettext("Toggle the display of the tool bar text"));
+ return new JCheckBoxMenuItem(action);
}
/**
@@ -191,7 +200,11 @@
* @return a check box that can be used to toggle the size of the icons
*/
public JMenuItem getIconSizeToggle() {
- JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(actions.addAction("ToolBarText", CWMsg.gettext("Large Tool Bar")).setTooltip(CWMsg.gettext("Toggle size of the tool bar icons")));
+ // TRANSLATOR: This is the label of a view option allowing a user to toggle between large and small icons on the tool bar
+ CWAction action = actions.addAction("ToolBarSize", CWMsg.gettext("Large Tool Bar"));
+ // TRANSLATOR: This is the tooltip for a view option allowing a user to toggle between large and small icons on the tool bar
+ action.setTooltip(CWMsg.gettext("Toggle size of the tool bar icons"));
+ JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(action);
toggle.setSelected(true);
return toggle;
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java 2011-03-07 17:22:59 UTC (rev 2103)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java 2011-03-07 18:54:34 UTC (rev 2104)
@@ -101,7 +101,11 @@
// Get the action definitions from the calling class
contextActions = actions;
+ // TRANSLATOR: This is the name of one of two different ways to present Bible Views.
+ // These show up in Options/Preferences.
tdiView = new JRadioButtonMenuItem(contextActions.addAction(TAB_MODE, CWMsg.gettext("Tabbed Document Interface")));
+ // TRANSLATOR: This is the name of one of two different ways to present Bible Views.
+ // These show up in Options/Preferences.
mdiView = new JRadioButtonMenuItem(contextActions.addAction(WINDOW_MODE, CWMsg.gettext("Multiple Document Interface")));
ButtonGroup grpViews = new ButtonGroup();
More information about the jsword-svn
mailing list