changeset 3116:2feed9b50047

SQ relation now creates Facets with proper i18n labels. flys-artifacts/trunk@4716 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 20 Jun 2012 08:13:01 +0000
parents 5482a8a48a3f
children e7ff82a52c88
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties
diffstat 6 files changed, 55 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Jun 20 07:49:36 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Jun 20 08:13:01 2012 +0000
@@ -1,3 +1,14 @@
+2012-06-20  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/SQRelation.java:
+	  Create new Facets with proper i18n label.
+
+	* src/main/resources/messages.properties,
+	  src/main/resources/messages_de_DE.properties,
+	  src/main/resources/messages_en.properties,
+	  src/main/resources/messages_de.properties: Added i18n strings for facet
+	  names.
+
 2012-06-20  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/sq/SQRelationGeneratorA.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java	Wed Jun 20 07:49:36 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java	Wed Jun 20 08:13:01 2012 +0000
@@ -6,6 +6,7 @@
 import org.apache.log4j.Logger;
 
 import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.CallMeta;
 
 import de.intevation.artifactdatabase.state.Facet;
 
@@ -20,6 +21,7 @@
 import de.intevation.flys.artifacts.model.sq.SQOutlierFacet;
 import de.intevation.flys.artifacts.model.sq.SQRelationCalculation;
 import de.intevation.flys.artifacts.model.sq.SQResult;
+import de.intevation.flys.artifacts.resources.Resources;
 import de.intevation.flys.artifacts.states.DefaultState;
 
 /**
@@ -30,6 +32,16 @@
     private static Logger logger = Logger.getLogger(SQRelation.class);
 
 
+    public static final String I18N_FACET_CURVE =
+        "facet.sq_relation.curve";
+
+    public static final String I18N_FACET_MEASUREMENTS =
+        "facet.sq_relation.measurements";
+
+    public static final String I18N_FACET_OUTLIERS =
+        "facet.sq_relation.outliers";
+
+
     public SQRelation() {
     }
 
@@ -57,7 +69,7 @@
         SQResult[] sqr = (SQResult[]) res.getData();
         logger.info("Calculation computed " + sqr.length + " SQResult objects");
 
-        createFacets(newFacets, sqr, hash);
+        createFacets(context, newFacets, sqr, hash);
 
         Facet csv = new DataFacet(
             CSV, "CSV data", ComputeType.ADVANCE, hash, id);
@@ -77,11 +89,13 @@
 
 
     protected void createFacets(
+        CallContext context,
         List<Facet> container,
         SQResult[]  sqr,
         String      hash
     ) {
-        String stateId = getID();
+        CallMeta meta    = context.getMeta();
+        String   stateId = getID();
 
         for (int res = 0, n = sqr.length; res < n; res++) {
 
@@ -97,7 +111,11 @@
                     res,
                     i,
                     getFractionFacetname(1, i),
-                    "Measurement (Fraction " + i + ")",
+                    Resources.getMsg(
+                        meta,
+                        I18N_FACET_MEASUREMENTS,
+                        I18N_FACET_MEASUREMENTS
+                    ),
                     hash,
                     stateId
                 ));
@@ -106,7 +124,11 @@
                     res,
                     i,
                     getFractionFacetname(0, i),
-                    "CURVE AT " + i,
+                    Resources.getMsg(
+                        meta,
+                        I18N_FACET_CURVE,
+                        I18N_FACET_CURVE
+                    ),
                     hash,
                     stateId
                 ));
@@ -117,7 +139,12 @@
                         i,
                         j,
                         getFractionFacetname(2, i),
-                        "OUTLIER AT " + i,
+                        Resources.getMsg(
+                            meta,
+                            I18N_FACET_OUTLIERS,
+                            I18N_FACET_OUTLIERS,
+                            new Object[] { j }
+                        ),
                         hash,
                         stateId
                     ));
--- a/flys-artifacts/src/main/resources/messages.properties	Wed Jun 20 07:49:36 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages.properties	Wed Jun 20 08:13:01 2012 +0000
@@ -147,6 +147,9 @@
 chart.sq_relation_d.title = Fein- und Mittelkies
 chart.sq_relation_e.title = Grobkornanteil (> Mittelkies)
 chart.sq_relation_f.title = Geschiebetransport gesamt
+facet.sq_relation.curve = Sedimenttransport
+facet.sq_relation.measurements = Messwerte
+facet.sq_relation.outliers = Ausrei\u00dfer Durchgang {0}
 
 facet.longitudinal_section.annotations = POIs
 facet.discharge_curves.mainvalues.q = Q (main values)
--- a/flys-artifacts/src/main/resources/messages_de.properties	Wed Jun 20 07:49:36 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Wed Jun 20 08:13:01 2012 +0000
@@ -146,6 +146,9 @@
 chart.sq_relation_d.title = Fein- und Mittelkies
 chart.sq_relation_e.title = Grobkornanteil (> Mittelkies)
 chart.sq_relation_f.title = Geschiebetransport gesamt
+facet.sq_relation.curve = Sedimenttransport
+facet.sq_relation.measurements = Messwerte
+facet.sq_relation.outliers = Ausrei\u00dfer Durchgang {0}
 
 facet.longitudinal_section.annotations = Streckenfavoriten
 facet.discharge_curves.mainvalues.q = Q (Haupt- und Extremwerte)
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Wed Jun 20 07:49:36 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Wed Jun 20 08:13:01 2012 +0000
@@ -144,6 +144,9 @@
 chart.sq_relation_d.title = Fein- und Mittelkies
 chart.sq_relation_e.title = Grobkornanteil (> Mittelkies)
 chart.sq_relation_f.title = Geschiebetransport gesamt
+facet.sq_relation.curve = Sedimenttransport
+facet.sq_relation.measurements = Messwerte
+facet.sq_relation.outliers = Ausrei\u00dfer Durchgang {0}
 
 facet.longitudinal_section.annotations = Streckenfavoriten
 facet.discharge_curves.mainvalues.q = Q (Haupt- und Extremwerte)
--- a/flys-artifacts/src/main/resources/messages_en.properties	Wed Jun 20 07:49:36 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Wed Jun 20 08:13:01 2012 +0000
@@ -146,6 +146,9 @@
 chart.sq_relation_d.title = Fein- und Mittelkies
 chart.sq_relation_e.title = Grobkornanteil (> Mittelkies)
 chart.sq_relation_f.title = Geschiebetransport gesamt
+facet.sq_relation.curve = Sedimenttransport
+facet.sq_relation.measurements = Messwerte
+facet.sq_relation.outliers = Ausrei\u00dfer Durchgang {0}
 
 facet.longitudinal_section.annotations = POIs
 facet.discharge_curves.mainvalues.q = Q (main values)

http://dive4elements.wald.intevation.org