l10n updates
This commit is contained in:
parent
8d2c5fd6e7
commit
27caf60161
@ -144,6 +144,9 @@ debuglogdlg.col.Message = Message
|
||||
debuglogdlg.lbl.Loglinenbr = Log line number:
|
||||
debuglogdlg.lbl.Time = Time:
|
||||
debuglogdlg.lbl.Level = Level:
|
||||
debuglogdlg.lbl.Location = Location:
|
||||
debuglogdlg.lbl.Logmessage = Log message:
|
||||
debuglogdlg.lbl.Stacktrace = Stack trace:
|
||||
|
||||
|
||||
! Edit Motor configuration dialog
|
||||
@ -485,6 +488,7 @@ componentanalysisdlg.println.settingnam = SETTING NAN VALUES
|
||||
componentanalysisdlg.lbl.reflenght = Reference length:
|
||||
componentanalysisdlg.lbl.refarea = Reference area:
|
||||
!componentanalysisdlg.But.close =Close
|
||||
componentanalysisdlg.TabStability.Col.Component = Component
|
||||
|
||||
! Custom Material dialog
|
||||
custmatdlg.title.Custommaterial = Custom material
|
||||
@ -754,6 +758,7 @@ ParachuteCfg.tab.ttip.Radialpos = Radial position configuration
|
||||
ParachuteCfg.lbl.Radialdistance = Radial distance:
|
||||
ParachuteCfg.lbl.Radialdirection = Radial direction:
|
||||
ParachuteCfg.but.Reset = Reset
|
||||
ParachuteCfg.lbl.plusdelay = plus
|
||||
|
||||
! ShockCordConfig
|
||||
ShockCordCfg.lbl.Shockcordlength = Shock cord length
|
||||
@ -799,6 +804,7 @@ StreamerCfg.tab.ttip.Radialpos = Radial position configuration
|
||||
StreamerCfg.lbl.Radialdistance = Radial distance:
|
||||
StreamerCfg.lbl.Radialdirection = Radial direction:
|
||||
StreamerCfg.but.Reset = Reset
|
||||
StreamerCfg.lbl.plusdelay = plus
|
||||
|
||||
! ThicknessRingComponentConfig
|
||||
ThicknessRingCompCfg.tab.Outerdiam = Outer diameter:
|
||||
|
||||
13
scripts/checkTranslations.sh
Executable file
13
scripts/checkTranslations.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Perform all tests for the translation files.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/checkTranslations.sh
|
||||
#
|
||||
|
||||
|
||||
# Test that keys used in Java files are present in English messages
|
||||
find src/ -name "*.java" -exec ./scripts/verifyTranslationKeys.pl l10n/messages.properties {} +
|
||||
|
||||
31
scripts/renameTranslationKeys.sh
Normal file
31
scripts/renameTranslationKeys.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Rename translation keys in translation files.
|
||||
#
|
||||
# Usage:
|
||||
# renameTranslationKeys.sh <mapping files...>
|
||||
#
|
||||
# The mapping files contain "<original> <new>" key pairs.
|
||||
# Empty lines and lines starting with "#" are ignored.
|
||||
# All translation files are modified at once.
|
||||
#
|
||||
|
||||
TRANSLATIONS=messages*.properties
|
||||
|
||||
cat "$@" | while read line; do
|
||||
|
||||
if echo "$line" | grep -q "^\s*$\|^\s*#"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! echo "$line" | egrep -q "^\s*[a-zA-Z0-9._-]+\s+[a-zA-Z0-9._-]+\s*$"; then
|
||||
echo "Invalid line: $line"
|
||||
fi
|
||||
|
||||
from="`echo $line | cut -d" " -f1`"
|
||||
to="`echo $line | cut -d" " -f2`"
|
||||
|
||||
sed -i "s/^${from}\s*=\s*/${to} = /" $TRANSLATIONS
|
||||
|
||||
done
|
||||
67
scripts/verifyTranslationKeys.pl
Executable file
67
scripts/verifyTranslationKeys.pl
Executable file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# Verify that keys used in Java files are present in the translation file.
|
||||
#
|
||||
# Usage:
|
||||
# verifyTranslationKeys.pl <property file> <Java files...>
|
||||
#
|
||||
# For example:
|
||||
# find src/ -name "*.java" -exec ./scripts/verifyTranslationKeys.pl l10n/messages.properties {} +
|
||||
#
|
||||
|
||||
|
||||
|
||||
# Read the translation file
|
||||
my %keys;
|
||||
print "Reading translation keys...\n";
|
||||
while ($str = <>) {
|
||||
if ($ARGV!~/\.properties/) {
|
||||
last;
|
||||
}
|
||||
|
||||
if ($str=~/^\s*($|[#!])/) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($str=~/^([a-zA-Z0-9._-]+)\s*=/) {
|
||||
$keys{$1} = 1;
|
||||
} else {
|
||||
print "ERROR: Invalid line in $ARGV: $str";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Read Java files
|
||||
my $oldFile = $ARGV;
|
||||
my $class="";
|
||||
print "Reading Java files...\n";
|
||||
while ($str = <>) {
|
||||
|
||||
# Check for new file
|
||||
if ($ARGV != $oldFile) {
|
||||
$class = "";
|
||||
}
|
||||
|
||||
# Check for irregular translator definition (exclude /l10n/ and /startup/)
|
||||
if ($str =~ / Translator / &&
|
||||
$str !~ /private static final Translator trans = Application.getTranslator\(\);/ &&
|
||||
$ARGV !~ /\/(l10n|startup)\//) {
|
||||
print "ERROR: Unusual translator usage in file $ARGV: $str";
|
||||
}
|
||||
|
||||
# Check for new class definition
|
||||
if ($str =~ /^[\sa-z]*class ([a-zA-Z0-9]+) /) {
|
||||
$class = $1;
|
||||
}
|
||||
|
||||
# Check for translator usage
|
||||
if ($str =~ /trans\.get\(\"([^\"]+)\"\)/) {
|
||||
$key = $1;
|
||||
if (!(exists $keys{$key}) &&
|
||||
!(exists $keys{$class . "." . $key})) {
|
||||
print "ERROR: Missing translation for '$key' in file $ARGV\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,6 +17,7 @@ import net.sf.openrocket.startup.Application;
|
||||
|
||||
|
||||
public class StageSelector extends JPanel implements ChangeListener {
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
private final Configuration configuration;
|
||||
|
||||
@ -64,7 +65,6 @@ public class StageSelector extends JPanel implements ChangeListener {
|
||||
|
||||
private class StageAction extends AbstractAction implements ChangeListener {
|
||||
private final int stage;
|
||||
private final Translator trans = Application.getTranslator();
|
||||
|
||||
public StageAction(final int stage) {
|
||||
this.stage = stage;
|
||||
|
||||
@ -23,8 +23,8 @@ import net.sf.openrocket.gui.components.UnitSelector;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.material.Material;
|
||||
import net.sf.openrocket.rocketcomponent.MassComponent;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount.IgnitionEvent;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.unit.UnitGroup;
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
* OpenRocketPrintable.java
|
||||
*/
|
||||
package net.sf.openrocket.gui.print;
|
||||
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
@ -18,6 +19,8 @@ public enum OpenRocketPrintable {
|
||||
//// Design Report
|
||||
DESIGN_REPORT("OpenRocketPrintable.DesignReport", false, 3);
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
/**
|
||||
* The description - will be displayed in the JTree.
|
||||
*/
|
||||
@ -52,7 +55,6 @@ public enum OpenRocketPrintable {
|
||||
* @return a displayable string
|
||||
*/
|
||||
public String getDescription() {
|
||||
final Translator trans = Application.getTranslator();
|
||||
return trans.get(description);
|
||||
}
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package net.sf.openrocket.rocketcomponent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.material.Material;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.unit.UnitGroup;
|
||||
import net.sf.openrocket.util.Prefs;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Class of components with well-defined physical appearance and which have an effect on
|
||||
* aerodynamic simulation. They have material defined for them, and the mass of the component
|
||||
@ -30,6 +30,7 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
//// Polished
|
||||
POLISHED("ExternalComponent.Polished", 2e-6);
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
private final String name;
|
||||
private final double roughnessSize;
|
||||
|
||||
@ -44,7 +45,6 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final Translator trans = Application.getTranslator();
|
||||
return trans.get(name) + " (" + UnitGroup.UNITS_ROUGHNESS.toStringUnit(roughnessSize) + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,11 +8,10 @@ import net.sf.openrocket.util.ChangeSource;
|
||||
import net.sf.openrocket.util.Coordinate;
|
||||
|
||||
public interface MotorMount extends ChangeSource {
|
||||
static final Translator trans = Application.getTranslator();
|
||||
|
||||
public static enum IgnitionEvent {
|
||||
//// Automatic (launch or ejection charge)
|
||||
AUTOMATIC(trans.get("MotorMount.IgnitionEvent.AUTOMATIC")) {
|
||||
AUTOMATIC("MotorMount.IgnitionEvent.AUTOMATIC") {
|
||||
@Override
|
||||
public boolean isActivationEvent(FlightEvent e, RocketComponent source) {
|
||||
int count = source.getRocket().getStageCount();
|
||||
@ -26,14 +25,14 @@ public interface MotorMount extends ChangeSource {
|
||||
}
|
||||
},
|
||||
//// Launch
|
||||
LAUNCH(trans.get("MotorMount.IgnitionEvent.LAUNCH")) {
|
||||
LAUNCH("MotorMount.IgnitionEvent.LAUNCH") {
|
||||
@Override
|
||||
public boolean isActivationEvent(FlightEvent e, RocketComponent source) {
|
||||
return (e.getType() == FlightEvent.Type.LAUNCH);
|
||||
}
|
||||
},
|
||||
//// First ejection charge of previous stage
|
||||
EJECTION_CHARGE(trans.get("MotorMount.IgnitionEvent.EJECTION_CHARGE")) {
|
||||
EJECTION_CHARGE("MotorMount.IgnitionEvent.EJECTION_CHARGE") {
|
||||
@Override
|
||||
public boolean isActivationEvent(FlightEvent e, RocketComponent source) {
|
||||
if (e.getType() != FlightEvent.Type.EJECTION_CHARGE)
|
||||
@ -45,7 +44,7 @@ public interface MotorMount extends ChangeSource {
|
||||
}
|
||||
},
|
||||
//// First burnout of previous stage
|
||||
BURNOUT(trans.get("MotorMount.IgnitionEvent.BURNOUT")) {
|
||||
BURNOUT("MotorMount.IgnitionEvent.BURNOUT") {
|
||||
@Override
|
||||
public boolean isActivationEvent(FlightEvent e, RocketComponent source) {
|
||||
if (e.getType() != FlightEvent.Type.BURNOUT)
|
||||
@ -57,7 +56,7 @@ public interface MotorMount extends ChangeSource {
|
||||
}
|
||||
},
|
||||
//// Never
|
||||
NEVER(trans.get("MotorMount.IgnitionEvent.NEVER")) {
|
||||
NEVER("MotorMount.IgnitionEvent.NEVER") {
|
||||
@Override
|
||||
public boolean isActivationEvent(FlightEvent e, RocketComponent source) {
|
||||
return false;
|
||||
@ -66,6 +65,7 @@ public interface MotorMount extends ChangeSource {
|
||||
;
|
||||
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
private final String description;
|
||||
|
||||
IgnitionEvent(String description) {
|
||||
@ -76,7 +76,7 @@ public interface MotorMount extends ChangeSource {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return description;
|
||||
return trans.get(description);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -21,23 +21,23 @@ public enum LineStyle {
|
||||
//// Dotted
|
||||
DOTTED("LineStyle.Dotted", new float[] { 2f, 3f }),
|
||||
//// Dash-dotted
|
||||
DASHDOT("LineStyle.Dash-dotted",new float[] { 8f, 3f, 2f, 3f})
|
||||
;
|
||||
DASHDOT("LineStyle.Dash-dotted", new float[] { 8f, 3f, 2f, 3f });
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
private final String name;
|
||||
private final float[] dashes;
|
||||
|
||||
LineStyle(String name, float[] dashes) {
|
||||
|
||||
this.name = name;
|
||||
this.dashes = dashes;
|
||||
}
|
||||
|
||||
public float[] getDashes() {
|
||||
return Arrays.copyOf(dashes, dashes.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final Translator trans = Application.getTranslator();
|
||||
return trans.get(name);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user