Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityMeasurementArtifact.java @ 7397:8ba53c5b86a7
issue1512: improved i18n for flow velocity measurement facets.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 18 Oct 2013 12:20:55 +0200 |
parents | ea5da3e140ef |
children | 20b1cfa1e005 |
comparison
equal
deleted
inserted
replaced
7396:a94b6e057daa | 7397:8ba53c5b86a7 |
---|---|
26 import org.dive4elements.artifacts.common.utils.XMLUtils; | 26 import org.dive4elements.artifacts.common.utils.XMLUtils; |
27 import org.dive4elements.river.model.FlowVelocityMeasurementValue; | 27 import org.dive4elements.river.model.FlowVelocityMeasurementValue; |
28 import org.dive4elements.river.artifacts.model.minfo.FlowVelocityMeasurementFacet; | 28 import org.dive4elements.river.artifacts.model.minfo.FlowVelocityMeasurementFacet; |
29 import org.dive4elements.river.artifacts.model.minfo.FlowVelocityMeasurementFactory; | 29 import org.dive4elements.river.artifacts.model.minfo.FlowVelocityMeasurementFactory; |
30 import org.dive4elements.river.artifacts.states.StaticState; | 30 import org.dive4elements.river.artifacts.states.StaticState; |
31 import org.dive4elements.river.artifacts.states.FlowVelocityState; | |
31 | 32 |
32 import org.dive4elements.river.artifacts.model.FacetTypes; | 33 import org.dive4elements.river.artifacts.model.FacetTypes; |
34 | |
35 import org.dive4elements.river.artifacts.resources.Resources; | |
33 | 36 |
34 import org.dive4elements.river.utils.Formatter; | 37 import org.dive4elements.river.utils.Formatter; |
35 | 38 |
36 | 39 |
37 /** Artefact to access flow velocity measurements. */ | 40 /** Artefact to access flow velocity measurements. */ |
43 private static Logger logger = | 46 private static Logger logger = |
44 Logger.getLogger(FlowVelocityMeasurementArtifact.class); | 47 Logger.getLogger(FlowVelocityMeasurementArtifact.class); |
45 | 48 |
46 /** Artifact key name. */ | 49 /** Artifact key name. */ |
47 private static final String NAME = "flowvelocitymeasurement"; | 50 private static final String NAME = "flowvelocitymeasurement"; |
51 | |
52 public static final String I18N_WATERLEVEL_FACET = | |
53 "facet.flow_velocity.waterlevel"; | |
54 | |
55 public static final String I18N_VELOCITY_FACET = | |
56 "facet.flow_velocity.velocity"; | |
48 | 57 |
49 /** Spawn only inactive facets. */ | 58 /** Spawn only inactive facets. */ |
50 static { | 59 static { |
51 // TODO: Move to configuration. | 60 // TODO: Move to configuration. |
52 FacetActivity.Registry.getInstance() | 61 FacetActivity.Registry.getInstance() |
128 String name = flowVelocityMeasurement.getDescription(); | 137 String name = flowVelocityMeasurement.getDescription(); |
129 logger.debug ("datetime " + flowVelocityMeasurement.getDatetime()); | 138 logger.debug ("datetime " + flowVelocityMeasurement.getDatetime()); |
130 name += " - " + dateFormatter.format( | 139 name += " - " + dateFormatter.format( |
131 flowVelocityMeasurement.getDatetime()); | 140 flowVelocityMeasurement.getDatetime()); |
132 | 141 |
133 // TODO naming/ i18N | |
134 Facet vFacet = new FlowVelocityMeasurementFacet( | 142 Facet vFacet = new FlowVelocityMeasurementFacet( |
135 FLOW_VELOCITY_MEASUREMENT, | 143 FLOW_VELOCITY_MEASUREMENT, |
136 "v " + name); | 144 Resources.getMsg(callMeta, I18N_WATERLEVEL_FACET, FlowVelocityState.I18N_TAU_FACET, new Object[] { name})); |
137 fs.add(vFacet); | 145 fs.add(vFacet); |
138 | 146 |
139 Facet qFacet = new FlowVelocityMeasurementFacet( | 147 Facet qFacet = new FlowVelocityMeasurementFacet( |
140 FLOW_VELOCITY_DISCHARGE, | 148 FLOW_VELOCITY_DISCHARGE, |
141 "q " + name); | 149 Resources.getMsg(callMeta, FlowVelocityState.I18N_DISCHARGE_FACET, FlowVelocityState.I18N_DISCHARGE_FACET, new Object[] { name})); |
142 fs.add(qFacet); | 150 fs.add(qFacet); |
143 | 151 |
144 Facet wFacet = new FlowVelocityMeasurementFacet( | 152 Facet wFacet = new FlowVelocityMeasurementFacet( |
145 FLOW_VELOCITY_WATERLEVEL, | 153 FLOW_VELOCITY_WATERLEVEL, |
146 "w " + name); | 154 Resources.getMsg(callMeta, I18N_VELOCITY_FACET, FlowVelocityState.I18N_TAU_FACET, new Object[] { name})); |
147 fs.add(wFacet); | 155 fs.add(wFacet); |
148 | 156 |
149 addFacets(state.getID(), fs); | 157 addFacets(state.getID(), fs); |
150 addStringData(DATA_NAME, code); | 158 addStringData(DATA_NAME, code); |
151 } | 159 } |