]> git.gag.com Git - debian/openrocket/commitdiff
Initial i18n support, bug fixes
authorplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Thu, 20 Jan 2011 06:13:49 +0000 (06:13 +0000)
committerplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Thu, 20 Jan 2011 06:13:49 +0000 (06:13 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@100 180e2498-e6e9-4542-8430-84ac67f01cd8

ChangeLog
l10n/messages.properties
pix-src/splashscreen-1.0.png
pix-src/splashscreen-1.0.xcf.gz
pix/splashscreen.png
run.sh
src/net/sf/openrocket/gui/main/SimulationPanel.java
src/net/sf/openrocket/gui/plot/PlotDialog.java
src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java
src/net/sf/openrocket/startup/Startup.java

index dfe86bb8436bca3b479ae410a4fa175685e4d130..a7fe5f9a918e3c1fe4e9faae5d0db19c7d79fd25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-20  Sampo Niskanen
+
+       * Initial i18n support
+
+2011-01-18  Sampo Niskanen
+
+       * [BUG] Simulation warnings were not being stored
+       * [BUG] Exclamation mark did not fit in simulation table
+       * Added instructions for zooming in plot dialog
+
+2010-12-01  Doug Pedrick
+
+       * Merging printing support
+
 2010-10-30  Sampo Niskanen
 
        * [BUG] Invalid refereces to components used in caches
@@ -6,7 +20,7 @@
 
        * [BUG] Take launch lug radial angle into account when loading rkt file
 
-2010-10-24  Sampo Niskane
+2010-10-24  Sampo Niskanen
 
        * Added SafetyMutex and took into use in Simulation
 
index 0071165b9fcd318474da95ce069b2144168dfd8f..9defd41b64354d4ecdb7bff8d57c781962cfc4e7 100644 (file)
@@ -4,6 +4,10 @@
 #
 
 
+! Set to the name of the current translation file (used for debugging purposes)
+debug.currentFile = messages.properties
+
+
 ! Labels used in buttons of dialog windows
 button.ok = OK
 button.cancel = Cancel
index 59ea9f222dc05457f79f46e083d714fc56b004c9..5af7cfb9c3cb654dd77bfb1fc7b282b2ff700d90 100644 (file)
Binary files a/pix-src/splashscreen-1.0.png and b/pix-src/splashscreen-1.0.png differ
index 40a3bab5482e8c3a90e8eec5dc851dbe48f6c792..063de3e5f9b0a339cd4301e51de3874b09b560cf 100644 (file)
Binary files a/pix-src/splashscreen-1.0.xcf.gz and b/pix-src/splashscreen-1.0.xcf.gz differ
index 59ea9f222dc05457f79f46e083d714fc56b004c9..5af7cfb9c3cb654dd77bfb1fc7b282b2ff700d90 100644 (file)
Binary files a/pix/splashscreen.png and b/pix/splashscreen.png differ
diff --git a/run.sh b/run.sh
index abf2f1c8c32c25e7306c35f19cf19d5a869bb2ce..1828ef78ca36b64d4362d6671d1f6091f40085b2 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -14,5 +14,5 @@ while echo "$1" | grep -q "^-" ; do
 done
 
 
-java -cp bin/:lib/miglayout15-swing.jar:lib/jcommon-1.0.16.jar:lib/jfreechart-1.0.13.jar:. $JAVAOPTS net.sf.openrocket.startup.Startup "$@"
+java -cp bin/:lib/miglayout15-swing.jar:lib/jcommon-1.0.16.jar:lib/jfreechart-1.0.13.jar:lib/iText-5.0.2.jar:. $JAVAOPTS net.sf.openrocket.startup.Startup "$@"
 
index 644605db8fd1529b1a599c5e3510322dbb8fd7a0..1760ed54d81be4435d6be3cdb4194293681eed42 100644 (file)
@@ -254,7 +254,7 @@ public class SimulationPanel extends JPanel {
                                        
                                        @Override
                                        public int getExactWidth() {
-                                               return 32;
+                                               return 36;
                                        }
                                        
                                        @Override
index de60e12558c460ce3993c056f95bdeac4e9d0a7a..b36ff30bf8dd6dd7b416d81fd008b186c85e60a1 100644 (file)
@@ -27,10 +27,12 @@ import javax.swing.BorderFactory;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JDialog;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 
 import net.miginfocom.swing.MigLayout;
 import net.sf.openrocket.document.Simulation;
+import net.sf.openrocket.gui.components.StyledLabel;
 import net.sf.openrocket.simulation.FlightDataBranch;
 import net.sf.openrocket.simulation.FlightDataType;
 import net.sf.openrocket.simulation.FlightEvent;
@@ -417,6 +419,11 @@ public class PlotDialog extends JDialog {
                });
                panel.add(check, "split, left");
                
+
+               JLabel label = new StyledLabel("Click+drag down+right to zoom in, up+left to zoom out", -2);
+               panel.add(label, "gapleft para");
+               
+
                panel.add(new JPanel(), "growx");
                
                JButton button = new JButton("Close");
index 655cdb52b780b3d2e0132c319be9ae884c4d2735..2740ca432d72741c7247663d1561f74f72e4eaaa 100644 (file)
@@ -6,7 +6,6 @@ import java.util.Set;
 
 import net.sf.openrocket.aerodynamics.FlightConditions;
 import net.sf.openrocket.aerodynamics.Warning;
-import net.sf.openrocket.aerodynamics.WarningSet;
 import net.sf.openrocket.logging.LogHelper;
 import net.sf.openrocket.motor.Motor;
 import net.sf.openrocket.motor.MotorId;
@@ -57,7 +56,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
                
                // Initialize the simulation
                currentStepper = flightStepper;
-               status = initialStatus(configuration, motorConfiguration, simulationConditions);
+               status = initialStatus(configuration, motorConfiguration, simulationConditions, flightData);
                status = currentStepper.initialize(status);
                
 
@@ -161,7 +160,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
 
        private SimulationStatus initialStatus(Configuration configuration,
                        MotorInstanceConfiguration motorConfiguration,
-                       SimulationConditions simulationConditions) {
+                       SimulationConditions simulationConditions, FlightData flightData) {
                
                SimulationStatus init = new SimulationStatus();
                init.setSimulationConditions(simulationConditions);
@@ -227,7 +226,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
                init.getEventQueue().add(new FlightEvent(FlightEvent.Type.LAUNCH, 0, simulationConditions.getRocket()));
                
                init.setFlightData(new FlightDataBranch("MAIN", FlightDataType.TYPE_TIME));
-               init.setWarnings(new WarningSet());
+               init.setWarnings(flightData.getWarningSet());
                
                return init;
        }
index 101e068ae30aa2159bac4740ba0586f13894b239..a9bcbcecfb9aa94ffe12410a40c001dd5e050b3a 100644 (file)
@@ -6,6 +6,7 @@ import java.awt.event.ActionListener;
 import java.io.File;
 import java.io.PrintStream;
 import java.util.List;
+import java.util.Locale;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.swing.JOptionPane;
@@ -26,6 +27,9 @@ import net.sf.openrocket.gui.main.BasicFrame;
 import net.sf.openrocket.gui.main.ExceptionHandler;
 import net.sf.openrocket.gui.main.SimpleFileFilter;
 import net.sf.openrocket.gui.main.Splash;
+import net.sf.openrocket.l10n.DebugTranslator;
+import net.sf.openrocket.l10n.ResourceBundleTranslator;
+import net.sf.openrocket.l10n.Translator;
 import net.sf.openrocket.logging.DelegatorLogger;
 import net.sf.openrocket.logging.LogHelper;
 import net.sf.openrocket.logging.LogLevel;
@@ -68,6 +72,9 @@ public class Startup {
                // Initialize logging first so we can use it
                initializeLogging();
                
+               // Setup the translations
+               initializeL10n();
+               
                // Check that we have a head
                checkHead();
                
@@ -94,6 +101,7 @@ public class Startup {
        
 
 
+
        private static void checkDebugStatus() {
                if (System.getProperty("openrocket.debug") != null) {
                        System.setProperty("openrocket.log.stdout", "VBOSE");
@@ -105,7 +113,38 @@ public class Startup {
        }
        
        
-
+       /**
+        * Initializes the localization system.
+        */
+       private static void initializeL10n() {
+               String locale = System.getProperty("openrocket.locale");
+               if (locale != null) {
+                       Locale l;
+                       String[] split = locale.split("[_-]", 3);
+                       if (split.length == 1) {
+                               l = new Locale(split[0]);
+                       } else if (split.length == 2) {
+                               l = new Locale(split[0], split[1]);
+                       } else {
+                               l = new Locale(split[0], split[1], split[2]);
+                       }
+                       Locale.setDefault(l);
+               }
+               
+               Translator t;
+               if (Locale.getDefault().getLanguage().equals("xx")) {
+                       t = new DebugTranslator();
+               } else {
+                       t = new ResourceBundleTranslator("l10n.messages");
+               }
+               
+               log.info("Set up translation for locale " + Locale.getDefault() +
+                               ", debug.currentFile=" + t.get("debug.currentFile"));
+               
+               Application.setTranslator(t);
+       }
+       
+       
 
        private static void runMain(String[] args) {