diff flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java @ 1615:07c38d054f91

Translate data item in locationpanel label. flys-client/trunk@3984 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 09 Feb 2012 08:51:00 +0000
parents 66671b69c7ea
children f13a7c126f24
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java	Thu Feb 09 08:47:39 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java	Thu Feb 09 08:51:00 2012 +0000
@@ -53,6 +53,7 @@
      * then entered in the texfield. */
     protected LocationPicker picker;
 
+
     /**
      * Creates a new LocationDistancePanel instance.
      */
@@ -77,7 +78,16 @@
         VLayout layout = new VLayout();
         layout.setMembersMargin(10);
 
-        Label label   = new Label(MSG.location ());
+        // Take translated data item name as label, if translation available.
+        String labelString;
+        try {
+            labelString = MSG.getString(getDataItemName());
+        }
+        catch(java.util.MissingResourceException mre) {
+            GWT.log("Cannot find translation for data item name : " + getDataItemName());
+            labelString = MSG.location(); 
+        }
+        Label label   = new Label(labelString);
         Canvas widget = createWidget(data);
         Canvas submit = getNextButton();
 
@@ -224,9 +234,9 @@
 
 
     /**
-     * This method returns the selected data.
+     * This method returns the selected data (to feed).
      *
-     * @return the selected/inserted data.
+     * @return the selected/inserted data in feedable form.
      */
     public Data[] getData() {
         saveLocationValues(locationPanel);
@@ -281,6 +291,7 @@
             url, river, "locations"));
     }
 
+
     // TODO allow multiple selections here or in LocationPanel
     /**
      * Callback when an item from the input helper was clicked.

http://dive4elements.wald.intevation.org