changeset 8267:99912f51468d

A bit less chaos in i18n for bed heights.
author "Tom Gottfried <tom@intevation.de>"
date Fri, 12 Sep 2014 19:00:45 +0200
parents 512b5c948881
children 05412bdcd9d5
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties artifacts/src/main/resources/messages_de_DE.properties artifacts/src/main/resources/messages_en.properties
diffstat 14 files changed, 68 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java	Fri Sep 12 19:00:45 2014 +0200
@@ -24,7 +24,7 @@
         ComputeType type, String stateId, String hash) {
         super(idx, name, description, type, hash, stateId);
         this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
-        this.metaData.put("Y", "chart.beddifference.yaxis.label.diff");
+        this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label");
     }
 
     public Object getData(Artifact artifact, CallContext context) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java	Fri Sep 12 19:00:45 2014 +0200
@@ -36,7 +36,7 @@
         ComputeType type, String stateId, String hash) {
         super(idx, name, description, type, hash, stateId);
         this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
-        this.metaData.put("Y", "chart.beddifference.yaxis.label.diff");
+        this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label");
     }
 
     public Object getData(Artifact artifact, CallContext context) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java	Fri Sep 12 19:00:45 2014 +0200
@@ -24,7 +24,7 @@
         ComputeType type, String stateId, String hash) {
         super(idx, name, description, type, hash, stateId);
         this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
-        this.metaData.put("Y", "chart.beddifference.yaxis.label.diff");
+        this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label");
     }
 
     public Object getData(Artifact artifact, CallContext context) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java	Fri Sep 12 19:00:45 2014 +0200
@@ -36,7 +36,7 @@
         ComputeType type, String stateId, String hash) {
         super(idx, name, description, type, hash, stateId);
         this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
-        this.metaData.put("Y", "chart.beddifference.yaxis.label.diff");
+        this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label");
     }
 
     public Object getData(Artifact artifact, CallContext context) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java	Fri Sep 12 19:00:45 2014 +0200
@@ -36,7 +36,7 @@
         this.type = type;
         this.index = 0;
         this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
-        this.metaData.put("Y", "chart.bedheight.height.yaxis.label");
+        this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label");
     }
 
     /**
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java	Fri Sep 12 19:00:45 2014 +0200
@@ -21,7 +21,7 @@
         this.description = description;
         this.index = 0;
         this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
-        this.metaData.put("Y", "chart.bedheight.height.yaxis.label");
+        this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label");
     }
 
     /**
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Fri Sep 12 19:00:45 2014 +0200
@@ -80,17 +80,17 @@
                 );
                 mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
-                    "chart.bedheight_middle.export.curelev",
+                    "meta.bedheight.cur.elevation",
                     "Current elevation model"),
                     d.getCurElevationModel());
                 mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
-                    "chart.bedheight_middle.export.oldelev",
+                    "meta.bedheight.old.elevation",
                     "Old elevation model"),
                     d.getOldElevationModel());
                 mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
-                    "chart.bedheight_middle.export.unit",
+                    "meta.bedheight.river.elevation",
                     "River elevation model"), u.getName());
                 newFacets.add(mf);
             }
@@ -105,17 +105,17 @@
                 );
                 mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
-                    "chart.bedheight_middle.export.curelev",
+                    "meta.bedheight.cur.elevation",
                     "Current elevation model"),
                     d.getCurElevationModel());
                 mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
-                    "chart.bedheight_middle.export.oldelev",
+                    "meta.bedheight.old.elevation",
                     "Old elevation model"),
                     d.getOldElevationModel());
                 mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
-                    "chart.bedheight_middle.export.unit",
+                    "meta.bedheight.river.elevation",
                     "River elevation model"), u.getName());
                 newFacets.add(mf);
             }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Fri Sep 12 19:00:45 2014 +0200
@@ -169,7 +169,7 @@
                     ComputeType.ADVANCE,
                     stateId,
                     hash));
-                 newFacets.add(new BedDiffHeightSubFacet(
+                newFacets.add(new BedDiffHeightSubFacet(
                     idx,
                     BED_DIFFERENCE_YEAR_HEIGHT2,
                     createBedDiffHeightDescription(
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Fri Sep 12 19:00:45 2014 +0200
@@ -64,31 +64,31 @@
         "export.bedheight_middle.csv.header.locations";
 
     public static final String CSV_META_YEAR =
-        "export.bedheight_middle.csv.header.year";
+        "meta.bedheight.year";
 
     public static final String CSV_META_TYPE =
-        "export.bedheight_middle.csv.header.type";
+        "meta.bedheight.type";
 
     public static final String CSV_META_CUR_ELEV_MODEL =
-        "export.bedheight_middle.csv.header.cur.elevation";
+        "meta.bedheight.cur.elevation";
 
     public static final String CSV_META_OLD_ELEV_MODEL =
-        "export.bedheight_middle.csv.header.old.elevation";
+        "meta.bedheight.old.elevation";
 
     public static final String CSV_META_RIVER_ELEV_MODEL =
-        "export.bedheight_middle.csv.header.river.elevation";
+        "meta.bedheight.river.elevation";
 
     public static final String CSV_META_SOUNDING_WIDTH =
-        "export.bedheight_middle.csv.header.sounding.width";
+        "meta.bedheight.sounding.width";
 
     public static final String CSV_META_RANGE =
-        "export.bedheight_middle.csv.header.range";
+        "meta.bedheight.range";
 
     public static final String CSV_META_LOC_SYSTEM =
-        "export.bedheight_middle.csv.header.location.system";
+        "meta.bedheight.location.system";
 
     public static final String CSV_META_EVAL_BY =
-        "export.bedheight_middle.csv.header.evalby";
+        "meta.bedheight.evalby";
 
     protected List<MiddleBedHeightData> data;
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java	Fri Sep 12 19:00:45 2014 +0200
@@ -15,6 +15,9 @@
 
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
 import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.CallMeta;
+
+import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.RiverAccess;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -29,10 +32,8 @@
     private final static Logger log =
             Logger.getLogger(BedHeightProcessor.class);
 
-    public static final String I18N_AXIS_LABEL_DEFAULT
-        = "Sohlhoehe [m]";
     public static final String I18N_AXIS_LABEL =
-        "chart.bedheight.height.yaxis.label";
+        "chart.bedheight_middle.section.yaxis.label";
 
     protected static final double GAP_TOLERANCE = 0.101d;
 
@@ -108,19 +109,19 @@
     @Override
     public String getAxisLabel(DiagramGenerator generator) {
         D4EArtifact flys = (D4EArtifact) generator.getMaster();
+        String unit = new RiverAccess(flys).getRiver().getWstUnit().getName();
 
-        RiverAccess access = new RiverAccess(flys);
-        String unit = access.getRiver().getWstUnit().getName();
+        CallMeta meta = generator.getCallContext().getMeta();
 
         if (yAxisLabel != null && !yAxisLabel.isEmpty()) {
-            return generator.msg(
+            return Resources.getMsg(
+                meta,
                 yAxisLabel,
-                I18N_AXIS_LABEL_DEFAULT,
                 new Object[] {unit});
         }
-        return generator.msg(
+        return Resources.getMsg(
+                meta,
                 I18N_AXIS_LABEL,
-                I18N_AXIS_LABEL_DEFAULT,
                 new Object[] { unit });
     }
 }
--- a/artifacts/src/main/resources/messages.properties	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/resources/messages.properties	Fri Sep 12 19:00:45 2014 +0200
@@ -225,11 +225,16 @@
 chart.bedheight_middle.section.title=Middle Bed Height
 chart.bedheight_middle.section.yaxis.label=middle Bed Height [{0}]
 chart.bedheight_middle.sounding.yaxis.label=Sounding Width [m]
-chart.bedheight_middle.export.unit = River elevation model
-chart.bedheight_middle.export.curelev = Current elevation model
-chart.bedheight_middle.export.oldelev = Old elevation model
 
-chart.bedheight.height.yaxis.label=Bed Height [{0}]
+meta.bedheight.year = Year
+meta.bedheight.type = Type
+meta.bedheight.cur.elevation = Current elevation model
+meta.bedheight.old.elevation = Old elevation model
+meta.bedheight.sounding.width = Sounding width
+meta.bedheight.range = Range
+meta.bedheight.location.system = Location system
+meta.bedheight.evalby = Evaluated by
+meta.bedheight.river.elevation = River elevation model
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Speed v [m/s]
@@ -429,15 +434,6 @@
 export.bedheight_middle.csv.header.soundingwidth = Sounding Width [m]
 export.bedheight_middle.csv.header.width = morphological active width [m]
 export.bedheight_middle.csv.header.locations = Location
-export.bedheight_middle.csv.header.year = Year
-export.bedheight_middle.csv.header.type = Type
-export.bedheight_middle.csv.header.cur.elevation = Current elevation model
-export.bedheight_middle.csv.header.old.elevation = Old elevation model
-export.bedheight_middle.csv.header.sounding.width = Sounding width
-export.bedheight_middle.csv.header.range = Range
-export.bedheight_middle.csv.header.location.system = Location system
-export.bedheight_middle.csv.header.evalby = Evaluated by
-export.bedheight_middle.csv.header.river.elevation = River elevation model
 
 export.sedimentload.csv.header.coarse = Coarse gravel [{0}]
 export.sedimentload.csv.header.fine_middle = Fine/Mid. gravel [{0}]
--- a/artifacts/src/main/resources/messages_de.properties	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Fri Sep 12 19:00:45 2014 +0200
@@ -225,11 +225,16 @@
 chart.bedheight_middle.section.title=Mittlere Sohlh\u00f6he
 chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [{0}]
 chart.bedheight_middle.sounding.yaxis.label=Gepeilte Breite [m]
-chart.bedheight_middle.export.unit = H\u00f6hensystem des Flusses
-chart.bedheight_middle.export.curelev = H\u00f6hensystem
-chart.bedheight_middle.export.oldelev = urspr\u00fcngliches H\u00f6hensystem
 
-chart.bedheight.height.yaxis.label=Sohlh\u00f6he [{0}]
+meta.bedheight.year = Jahr
+meta.bedheight.type = Aufnahmeart
+meta.bedheight.cur.elevation = H\u00f6hensystem
+meta.bedheight.old.elevation = urspr\u00fcngliches H\u00f6hensystem
+meta.bedheight.sounding.width = ausgewertete Peilbreite
+meta.bedheight.range = Strecke
+meta.bedheight.location.system = Lagesystem
+meta.bedheight.evalby = Auswerter
+meta.bedheight.river.elevation = H\u00f6hensystem des Flusses
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Geschwindigkeit v [m/s]
@@ -431,15 +436,6 @@
 export.bedheight_middle.csv.header.soundingwidth = Peilbreite [m]
 export.bedheight_middle.csv.header.width = morphologisch ausgewertete Breite [m]
 export.bedheight_middle.csv.header.locations = Streckendaten
-export.bedheight_middle.csv.header.year = Jahr
-export.bedheight_middle.csv.header.type = Aufnahmeart
-export.bedheight_middle.csv.header.cur.elevation = H\u00f6hensystem
-export.bedheight_middle.csv.header.old.elevation = urspr\u00fcngliches H\u00f6hensystem
-export.bedheight_middle.csv.header.river.elevation = H\u00f6hensystem des Flusses
-export.bedheight_middle.csv.header.sounding.width = ausgewertete Peilbreite
-export.bedheight_middle.csv.header.range = Strecke
-export.bedheight_middle.csv.header.location.system = Lagesystem
-export.bedheight_middle.csv.header.evalby = Auswerter
 
 export.sedimentload.csv.header.coarse = Grober Kies/Steine [{0}]
 export.sedimentload.csv.header.fine_middle = Fein/Mittlerer Kies [{0}]
--- a/artifacts/src/main/resources/messages_de_DE.properties	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Fri Sep 12 19:00:45 2014 +0200
@@ -224,11 +224,16 @@
 chart.bedheight_middle.section.title=Mittlere Sohlh\u00f6he
 chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [{0}]
 chart.bedheight_middle.sounding.yaxis.label=Gepeilte Breite [m]
-chart.bedheight_middle.export.unit = H\u00f6hensystem des Flusses
-chart.bedheight_middle.export.curelev = H\u00f6hensystem
-chart.bedheight_middle.export.oldelev = urspr\u00fcngliches H\u00f6hensystem
 
-chart.bedheight.height.yaxis.label=Sohlh\u00f6he [{0}]
+meta.bedheight.year = Jahr
+meta.bedheight.type = Aufnahmeart
+meta.bedheight.cur.elevation = H\u00f6hensystem
+meta.bedheight.old.elevation = urspr\u00fcngliches H\u00f6hensystem
+meta.bedheight.sounding.width = ausgewertete Peilbreite
+meta.bedheight.range = Strecke
+meta.bedheight.location.system = Lagesystem
+meta.bedheight.evalby = Auswerter
+meta.bedheight.river.elevation = H\u00f6hensystem des Flusses
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Geschwindigkeit v [m/s]
@@ -428,15 +433,6 @@
 export.bedheight_middle.csv.header.soundingwidth = Peilbreite [m]
 export.bedheight_middle.csv.header.width = morphologisch ausgewertete Breite [m]
 export.bedheight_middle.csv.header.locations = Streckendaten
-export.bedheight_middle.csv.header.year = Jahr
-export.bedheight_middle.csv.header.type = Aufnahmeart
-export.bedheight_middle.csv.header.cur.elevation = H\u00f6hensystem
-export.bedheight_middle.csv.header.old.elevation = urspr\u00fcngliches H\u00f6hensystem
-export.bedheight_middle.csv.header.sounding.width = ausgewertete Peilbreite
-export.bedheight_middle.csv.header.range = Strecke
-export.bedheight_middle.csv.header.location.system = Lagesystem
-export.bedheight_middle.csv.header.evalby = Auswerter
-export.bedheight_middle.csv.header.river.elevation = H\u00f6hensystem des Flusses
 
 export.sedimentload.csv.header.coarse = Grober Kies/Steine [{0}]
 export.sedimentload.csv.header.fine_middle = Fein/Mittlerer Kies [{0}]
--- a/artifacts/src/main/resources/messages_en.properties	Fri Sep 12 14:56:49 2014 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Fri Sep 12 19:00:45 2014 +0200
@@ -227,11 +227,16 @@
 chart.bedheight_middle.section.title=Middle Bed Height
 chart.bedheight_middle.section.yaxis.label=middle Bed Height [{0}]
 chart.bedheight_middle.sounding.yaxis.label=Sounding Width [m]
-chart.bedheight_middle.export.unit = River elevation model
-chart.bedheight_middle.export.curelev = Current elevation model
-chart.bedheight_middle.export.oldelev = Old elevation model
 
-chart.bedheight.height.yaxis.label=Bed Height [{0}]
+meta.bedheight.year = Year
+meta.bedheight.type = Type
+meta.bedheight.cur.elevation = Current elevation model
+meta.bedheight.old.elevation = Old elevation model
+meta.bedheight.sounding.width = Sounding width
+meta.bedheight.range = Range
+meta.bedheight.location.system = Location system
+meta.bedheight.evalby = Evaluated by
+meta.bedheight.river.elevation = River elevation model
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Speed v [m/s]
@@ -431,15 +436,6 @@
 export.bedheight_middle.csv.header.soundingwidth = Sounding Width [m]
 export.bedheight_middle.csv.header.width = morphological active width [m]
 export.bedheight_middle.csv.header.locations = Location
-export.bedheight_middle.csv.header.year = Year
-export.bedheight_middle.csv.header.type = Type
-export.bedheight_middle.csv.header.cur.elevation = Current elevation model
-export.bedheight_middle.csv.header.old.elevation = Old elevation model
-export.bedheight_middle.csv.header.sounding.width = Sounding width
-export.bedheight_middle.csv.header.range = Range
-export.bedheight_middle.csv.header.location.system = Location system
-export.bedheight_middle.csv.header.evalby = Evaluated by
-export.bedheight_middle.csv.header.river.elevation = River elevation model
 
 export.sedimentload.csv.header.coarse = Coarse gravel [{0}]
 export.sedimentload.csv.header.fine_middle = Fine/Mid. gravel [{0}]

http://dive4elements.wald.intevation.org