915: TDM - Support the Spanish language

Task-Url: https://support.d4science.org/issues/915

Updated Spanish support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@119546 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-08 17:18:39 +00:00
parent cc8a0f6e96
commit e715c6313b
3 changed files with 71 additions and 19 deletions

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
@ -17,8 +18,10 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
public class PositionColumnDialog extends Window {
private static final int WIDTH=400;
private static final int HEIGHT=120;
private PositionColumnMessages msgs;
public PositionColumnDialog(TRId trId, EventBus eventBus) {
msgs = GWT.create(PositionColumnMessages.class);
initWindow();
PositionColumnPanel changeColumnsPositionPanel= new PositionColumnPanel(trId, eventBus);
@ -30,7 +33,7 @@ public class PositionColumnDialog extends Window {
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Change Columns Position");
setHeadingText(msgs.dialogHeadingText());
//getHeader().setIcon(Resources.IMAGES.side_list());
}

View File

@ -0,0 +1,46 @@
package org.gcube.portlets.user.td.columnwidget.client;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface PositionColumnMessages extends Messages {
@DefaultMessage("Change Columns Position")
String dialogHeadingText();
//
@DefaultMessage("Columns")
String labelColHeader();
// Apply Button
@DefaultMessage("Apply")
String applyBtnText();
@DefaultMessage("Apply Position Columns")
String applyBtnToolTip();
@DefaultMessage("Use drag and drop in order to change the position of the columns:")
String tipForReorganization();
// Error
@DefaultMessage("Error retrieving columns")
String errorRetrievingColumnsHead();
@DefaultMessage("Error retrieving columns!")
String errorRetrievingColumns();
@DefaultMessage("Attention no column change!")
String attentionNoColumnChange();
@DefaultMessage("Error changing the position of the columns! ")
String errorChangingPositionOfColumns();
@DefaultMessage("Positions Updated!")
String positionUpdated();
}

View File

@ -73,7 +73,7 @@ public class PositionColumnPanel extends FramedPanel {
private PositionColumnDialog parent;
private TRId trId;
private TextButton reorder;
private TextButton applyBtn;
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
private Grid<ColumnData> grid;
@ -82,8 +82,11 @@ public class PositionColumnPanel extends FramedPanel {
private ChangeColumnsPositionSession changeColumnsPositionSession;
private ListStore<ColumnData> store;
private PositionColumnMessages msgs;
public PositionColumnPanel(TRId trId, EventBus eventBus) {
msgs = GWT.create(PositionColumnMessages.class);
this.trId = trId;
this.eventBus = eventBus;
Log.debug("ReorderColumnsPanel(): [" + trId.toString() + "]");
@ -103,7 +106,7 @@ public class PositionColumnPanel extends FramedPanel {
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
props.label());
labelCol.setHeader("Columns");
labelCol.setHeader(msgs.labelColHeader());
//IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
sm = new GridSelectionModel<ColumnData>();
@ -190,11 +193,11 @@ public class PositionColumnPanel extends FramedPanel {
dt.setAllowSelfAsSource(true);
// Delete Button
reorder = new TextButton("Apply");
reorder.setIcon(ResourceBundle.INSTANCE.columnReorder());
reorder.setIconAlign(IconAlign.RIGHT);
reorder.setToolTip("Apply Position Columns");
// Apply Button
applyBtn = new TextButton(msgs.applyBtnText());
applyBtn.setIcon(ResourceBundle.INSTANCE.columnReorder());
applyBtn.setIconAlign(IconAlign.RIGHT);
applyBtn.setToolTip(msgs.applyBtnToolTip());
SelectHandler deleteHandler = new SelectHandler() {
@ -203,16 +206,16 @@ public class PositionColumnPanel extends FramedPanel {
}
};
reorder.addSelectHandler(deleteHandler);
applyBtn.addSelectHandler(deleteHandler);
HTML columnsLabel = new HTML("<p>Use drag and drop in order to change the position of the columns:</p>");
HTML tipForReorganization = new HTML("<p>"+msgs.tipForReorganization()+"</p>");
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
hBox.add(reorder, new BoxLayoutData(new Margins(2, 5, 2, 5)));
hBox.add(applyBtn, new BoxLayoutData(new Margins(2, 5, 2, 5)));
VerticalLayoutContainer v = new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTOY);
v.setAdjustForScroll(true);
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
v.add(tipForReorganization, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
1)));
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
@ -252,8 +255,8 @@ public class PositionColumnPanel extends FramedPanel {
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
UtilsGXT3.alert(msgs.errorRetrievingColumnsHead(),
msgs.errorRetrievingColumns());
}
}
}
@ -265,7 +268,7 @@ public class PositionColumnPanel extends FramedPanel {
try {
Log.debug("loaded " + result.size() + " ColumnData");
if(result.size()<=1){
reorder.disable();
applyBtn.disable();
}
callback.onSuccess(new ListLoadResultBean<ColumnData>(
@ -288,7 +291,7 @@ public class PositionColumnPanel extends FramedPanel {
protected void onReorderColumns() {
ArrayList<ColumnData> columns = getReorderedColumns();
if (columns == null || columns.size() < 1) {
UtilsGXT3.alert("Attention", "Attention no column change!");
UtilsGXT3.alert("Attention", msgs.attentionNoColumnChange());
return;
} else {
callReorderColumn(columns);
@ -323,7 +326,7 @@ public class PositionColumnPanel extends FramedPanel {
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error",
"Error changing the position of the columns! "+caught.getLocalizedMessage());
msgs.errorChangingPositionOfColumns()+caught.getLocalizedMessage());
}
}
}
@ -331,7 +334,7 @@ public class PositionColumnPanel extends FramedPanel {
public void onSuccess(Void result) {
UtilsGXT3
.info("Success", "Positions Updated");
.info("Success", msgs.positionUpdated());
syncOpComplete();
//openMonitorDialog(taskId);