# HG changeset patch # User Ingo Weinzierl # Date 1300120362 0 # Node ID 206312c2aa76d34b28ab4431f6669c85a5437607 # Parent 21d791e21aca7a6b8ff65ce220236425cd54d230 I18N of strings for the DESCRIBE document. flys-artifacts/trunk@1468 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 21d791e21aca -r 206312c2aa76 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Mar 14 15:47:10 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Mar 14 16:32:42 2011 +0000 @@ -1,3 +1,14 @@ +2011-03-14 Ingo Weinzierl + + * src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java, + src/main/java/de/intevation/flys/artifacts/states/DefaultState.java: + I18N of strings for the DESCRIBE document. + + * src/main/resources/messages.properties, + src/main/resources/messages_en.properties, + src/main/resources/messages_de.properties: I18N strings for the + calculcation mode state. + 2011-03-14 Ingo Weinzierl * doc/conf/artifacts/winfo.xml: Modified the winfo states. diff -r 21d791e21aca -r 206312c2aa76 flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Mon Mar 14 15:47:10 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Mon Mar 14 16:32:42 2011 +0000 @@ -23,6 +23,7 @@ import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.flys.artifacts.context.FLYSContext; +import de.intevation.flys.artifacts.resources.Resources; /** @@ -54,7 +55,7 @@ * This method returns a description of this artifact. * * @param data Some data. - * @param CallContext The CallContext. + * @param context The CallContext. * * @return the description of this artifact. */ @@ -99,6 +100,8 @@ Element staticUI = ProtocolUtils.createArtNode( creator, "static", null, null); + appendStaticUI(creator, staticUI, context); + Element dynamic = current.describe( description, root, @@ -106,10 +109,9 @@ identifier()); ui.appendChild(dynamic); + ui.appendChild(staticUI); root.appendChild(ui); - appendStaticUI(creator, ui); - return description; } @@ -131,7 +133,11 @@ * @param cr The ElementCreator that is used to create new elements. * @param ui The static ui node. */ - protected void appendStaticUI(XMLUtils.ElementCreator cr, Node ui) { + protected void appendStaticUI( + XMLUtils.ElementCreator cr, + Node ui, + CallContext context) + { Set keys = data.keySet(); // XXX This just handles single selection string values. If we need more @@ -141,9 +147,13 @@ for (String k: keys) { logger.debug("The key = " + k); StateData d = getData(k); + String name = Resources.getMsg( + context.getMeta(), + d.getName(), + d.getName()); Element dataElement = cr.create("data"); - cr.addAttr(dataElement, "name", (String) d.getName(), true); + cr.addAttr(dataElement, "name", name, true); cr.addAttr(dataElement, "type", d.getType(), true); Element itemElement = cr.create("item"); diff -r 21d791e21aca -r 206312c2aa76 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java Mon Mar 14 15:47:10 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java Mon Mar 14 16:32:42 2011 +0000 @@ -85,9 +85,14 @@ StateData data, CallContext context) { + String name = Resources.getMsg( + context.getMeta(), + data.getName(), + data.getName()); + Element select = ProtocolUtils.createArtNode( cr, "select", null, null); - cr.addAttr(select, "name", data.getName()); + cr.addAttr(select, "name", name, true); Element label = ProtocolUtils.createArtNode( cr, "label", null, null); diff -r 21d791e21aca -r 206312c2aa76 flys-artifacts/src/main/resources/messages.properties --- a/flys-artifacts/src/main/resources/messages.properties Mon Mar 14 15:47:10 2011 +0000 +++ b/flys-artifacts/src/main/resources/messages.properties Mon Mar 14 16:32:42 2011 +0000 @@ -1,2 +1,5 @@ state.winfo.river = River state.winfo.calculation_mode = Calculation Mode + +river = River +calculation_mode = Calculation Mode diff -r 21d791e21aca -r 206312c2aa76 flys-artifacts/src/main/resources/messages_de.properties --- a/flys-artifacts/src/main/resources/messages_de.properties Mon Mar 14 15:47:10 2011 +0000 +++ b/flys-artifacts/src/main/resources/messages_de.properties Mon Mar 14 16:32:42 2011 +0000 @@ -1,2 +1,5 @@ state.winfo.river = Fluss state.winfo.calculation_mode = Berechnungsart + +river = Fluss +calculation_mode = Berechnungsart diff -r 21d791e21aca -r 206312c2aa76 flys-artifacts/src/main/resources/messages_en.properties --- a/flys-artifacts/src/main/resources/messages_en.properties Mon Mar 14 15:47:10 2011 +0000 +++ b/flys-artifacts/src/main/resources/messages_en.properties Mon Mar 14 16:32:42 2011 +0000 @@ -1,2 +1,5 @@ state.winfo.river = River state.winfo.calculation_mode = Calculation Mode + +river = River +calculation_mode = Calculation Mode