comparison artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityModelArtifact.java @ 7534:00950f79b0d9

issue1512: i18n.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 07 Nov 2013 11:10:58 +0100
parents 9eef5004ff21
children 8d5ca5175038
comparison
equal deleted inserted replaced
7533:20b1cfa1e005 7534:00950f79b0d9
31 import org.dive4elements.river.artifacts.model.FlowVelocityFacet; 31 import org.dive4elements.river.artifacts.model.FlowVelocityFacet;
32 import org.dive4elements.river.artifacts.states.StaticState; 32 import org.dive4elements.river.artifacts.states.StaticState;
33 33
34 import org.dive4elements.river.artifacts.model.FacetTypes; 34 import org.dive4elements.river.artifacts.model.FacetTypes;
35 35
36 import org.dive4elements.river.artifacts.resources.Resources;
36 37
37 /** Artifact to access flow velocity models. */ 38 /** Artifact to access flow velocity models. */
38 public class FlowVelocityModelArtifact 39 public class FlowVelocityModelArtifact
39 extends StaticD4EArtifact 40 extends StaticD4EArtifact
40 implements FacetTypes 41 implements FacetTypes
43 private static Logger logger = 44 private static Logger logger =
44 Logger.getLogger(FlowVelocityModelArtifact.class); 45 Logger.getLogger(FlowVelocityModelArtifact.class);
45 46
46 /** Artifact key name. */ 47 /** Artifact key name. */
47 private static final String NAME = "flowvelocitymodel"; 48 private static final String NAME = "flowvelocitymodel";
49
50 private static final String I18N_MAINCHANNEL =
51 "facet.flow_velocity.model.mainchannel";
52
53 private static final String I18N_TAU =
54 "facet.flow_velocity.model.tau";
55
56 private static final String I18N_TOTALCHANNEL =
57 "facet.flow_velocity.model.totalchannel";
58
59 private static final String I18N_Q =
60 "facet.flow_velocity.model.q";
48 61
49 /** Spawn only inactive facets. */ 62 /** Spawn only inactive facets. */
50 static { 63 static {
51 // TODO: Move to configuration. 64 // TODO: Move to configuration.
52 FacetActivity.Registry.getInstance() 65 FacetActivity.Registry.getInstance()
145 String name = FlowVelocityModel.getModelDescription(Integer.valueOf(code)); 158 String name = FlowVelocityModel.getModelDescription(Integer.valueOf(code));
146 159
147 Facet facet = new FlowVelocityFacet( 160 Facet facet = new FlowVelocityFacet(
148 0, 161 0,
149 FLOW_VELOCITY_MAINCHANNEL, 162 FLOW_VELOCITY_MAINCHANNEL,
150 "mainchannel " + name, 163 Resources.getMsg(callMeta,
164 I18N_MAINCHANNEL,
165 new Object[] { name } ),
151 ComputeType.ADVANCE, state.getID(), "hash" 166 ComputeType.ADVANCE, state.getID(), "hash"
152 ); 167 );
153 fs.add(facet); 168 fs.add(facet);
154 Facet tauFacet = new FlowVelocityFacet( 169 Facet tauFacet = new FlowVelocityFacet(
155 0, 170 0,
156 FLOW_VELOCITY_TAU, 171 FLOW_VELOCITY_TAU,
157 "tau " + name, 172 Resources.getMsg(callMeta,
173 I18N_TAU,
174 new Object[] { name} ),
158 ComputeType.ADVANCE, state.getID(), "hash" 175 ComputeType.ADVANCE, state.getID(), "hash"
159 ); 176 );
160 fs.add(tauFacet); 177 fs.add(tauFacet);
161 Facet qFacet = new FlowVelocityFacet( 178 Facet qFacet = new FlowVelocityFacet(
162 0, 179 0,
163 FLOW_VELOCITY_DISCHARGE, 180 FLOW_VELOCITY_DISCHARGE,
164 "Q " + name, 181 Resources.getMsg(callMeta,
182 I18N_Q,
183 new Object[] { name} ),
165 ComputeType.ADVANCE, state.getID(), "hash" 184 ComputeType.ADVANCE, state.getID(), "hash"
166 ); 185 );
167 fs.add(qFacet); 186 fs.add(qFacet);
168 Facet tFacet = new FlowVelocityFacet( 187 Facet tFacet = new FlowVelocityFacet(
169 0, 188 0,
170 FLOW_VELOCITY_TOTALCHANNEL, 189 FLOW_VELOCITY_TOTALCHANNEL,
171 "total "+ name, 190 Resources.getMsg(callMeta,
191 I18N_TOTALCHANNEL,
192 new Object[] { name} ),
172 ComputeType.ADVANCE, state.getID(), "hash" 193 ComputeType.ADVANCE, state.getID(), "hash"
173 ); 194 );
174 fs.add(tFacet); 195 fs.add(tFacet);
175 addFacets(state.getID(), fs); 196 addFacets(state.getID(), fs);
176 addStringData(DATA_ID, code); 197 addStringData(DATA_ID, code);

http://dive4elements.wald.intevation.org