mirror of https://github.com/rusefi/RomRaider.git
Internationalize Table class
This commit is contained in:
parent
eb5c46987d
commit
bad4727fd5
|
@ -0,0 +1,7 @@
|
||||||
|
USERLVLTOLOW = This table can only be modified by users with a userlevel of \n{0} or greater. Click View->User Level to change your userlevel.
|
||||||
|
TBLNOTMODIFY = Table cannot be modified
|
||||||
|
REALBYTEINVALID = The real value and byte value conversion expressions for table {0} are invalid.
|
||||||
|
REALVALUE = To real value: {0}
|
||||||
|
BYTEVALUE = To byte: {0}
|
||||||
|
DISPLAYMSG = Always display this message
|
||||||
|
WARNING = Warning
|
|
@ -35,6 +35,8 @@ import java.awt.event.KeyEvent;
|
||||||
import java.awt.event.KeyListener;
|
import java.awt.event.KeyListener;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
@ -57,12 +59,15 @@ import com.romraider.editor.ecu.ECUEditorManager;
|
||||||
import com.romraider.swing.TableToolBar;
|
import com.romraider.swing.TableToolBar;
|
||||||
import com.romraider.util.JEPUtil;
|
import com.romraider.util.JEPUtil;
|
||||||
import com.romraider.util.NumberUtil;
|
import com.romraider.util.NumberUtil;
|
||||||
|
import com.romraider.util.ResourceUtil;
|
||||||
import com.romraider.util.SettingsManager;
|
import com.romraider.util.SettingsManager;
|
||||||
import com.romraider.xml.RomAttributeParser;
|
import com.romraider.xml.RomAttributeParser;
|
||||||
|
|
||||||
public abstract class Table extends JPanel implements Serializable {
|
public abstract class Table extends JPanel implements Serializable {
|
||||||
private static final long serialVersionUID = 6559256489995552645L;
|
private static final long serialVersionUID = 6559256489995552645L;
|
||||||
protected static final Logger LOGGER = Logger.getLogger(Table.class);
|
protected static final Logger LOGGER = Logger.getLogger(Table.class);
|
||||||
|
private static final ResourceBundle rb = new ResourceUtil().getBundle(
|
||||||
|
Table.class.getName());
|
||||||
protected static final String ST_DELIMITER = "\t\n\r\f";
|
protected static final String ST_DELIMITER = "\t\n\r\f";
|
||||||
protected static Settings.Endian memModelEndian;
|
protected static Settings.Endian memModelEndian;
|
||||||
|
|
||||||
|
@ -941,9 +946,9 @@ public abstract class Table extends JPanel implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (userLevel > getSettings().getUserLevel()) {
|
} else if (userLevel > getSettings().getUserLevel()) {
|
||||||
JOptionPane.showMessageDialog(this, "This table can only be modified by users with a userlevel of \n" +
|
JOptionPane.showMessageDialog(this, MessageFormat.format(
|
||||||
userLevel + " or greater. Click View->User Level to change your userlevel.",
|
rb.getString("USERLVLTOLOW"), userLevel),
|
||||||
"Table cannot be modified",
|
rb.getString("TBLNOTMODIFY"),
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -962,9 +967,9 @@ public abstract class Table extends JPanel implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (userLevel > getSettings().getUserLevel()) {
|
} else if (userLevel > getSettings().getUserLevel()) {
|
||||||
JOptionPane.showMessageDialog(this, "This table can only be modified by users with a userlevel of \n" +
|
JOptionPane.showMessageDialog(this, MessageFormat.format(
|
||||||
userLevel + " or greater. Click View->User Level to change your userlevel.",
|
rb.getString("USERLVLTOLOW"), userLevel),
|
||||||
"Table cannot be modified",
|
rb.getString("TBLNOTMODIFY"),
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -977,9 +982,9 @@ public abstract class Table extends JPanel implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (userLevel > getSettings().getUserLevel()) {
|
} else if (userLevel > getSettings().getUserLevel()) {
|
||||||
JOptionPane.showMessageDialog(this, "This table can only be modified by users with a userlevel of \n" +
|
JOptionPane.showMessageDialog(this, MessageFormat.format(
|
||||||
userLevel + " or greater. Click View->User Level to change your userlevel.",
|
rb.getString("USERLVLTOLOW"), userLevel),
|
||||||
"Table cannot be modified",
|
rb.getString("TBLNOTMODIFY"),
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1276,11 +1281,14 @@ public abstract class Table extends JPanel implements Serializable {
|
||||||
|
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
panel.setLayout(new GridLayout(4, 1));
|
panel.setLayout(new GridLayout(4, 1));
|
||||||
panel.add(new JLabel("The real value and byte value conversion expressions for table " + getName() + " are invalid."));
|
panel.add(new JLabel(MessageFormat.format(
|
||||||
panel.add(new JLabel("To real value: " + scale.getExpression()));
|
rb.getString("REALBYTEINVALID"), getName())));
|
||||||
panel.add(new JLabel("To byte: " + scale.getByteExpression()));
|
panel.add(new JLabel(MessageFormat.format(
|
||||||
|
rb.getString("REALVALUE"), scale.getExpression())));
|
||||||
|
panel.add(new JLabel(MessageFormat.format(
|
||||||
|
rb.getString("BYTEVALUE"), scale.getByteExpression())));
|
||||||
|
|
||||||
JCheckBox check = new JCheckBox("Always display this message", true);
|
JCheckBox check = new JCheckBox(rb.getString("DISPLAYMSG"), true);
|
||||||
check.setHorizontalAlignment(JCheckBox.RIGHT);
|
check.setHorizontalAlignment(JCheckBox.RIGHT);
|
||||||
panel.add(check);
|
panel.add(check);
|
||||||
|
|
||||||
|
@ -1294,7 +1302,7 @@ public abstract class Table extends JPanel implements Serializable {
|
||||||
);
|
);
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(SwingUtilities.windowForComponent(this), panel,
|
JOptionPane.showMessageDialog(SwingUtilities.windowForComponent(this), panel,
|
||||||
"Warning", JOptionPane.ERROR_MESSAGE);
|
rb.getString("WARNING"), JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue