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-csv-import-widget@119941 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-21 15:04:38 +00:00
parent 454ff0350c
commit 2f4309c3dc
8 changed files with 70 additions and 22 deletions

View File

@ -195,5 +195,23 @@ public interface CSVImportWizardTDMessages extends Messages {
@DefaultMessage("Error uploading the csv file")
String errorUploadingCSVFileHead();
@DefaultMessage("Document: ")
String csvOperationInProgressDocumentLabel();
@DefaultMessage("Source: ")
String csvOperationInProgressSourceLabel();
@DefaultMessage("File: ")
String csvOperationInProgressFileLabel();
@DefaultMessage("Import Summary")
String summaryImport();
@DefaultMessage("CSV File")
String csvOperationInProgressCSVFile();
@DefaultMessage("An error occured in import CSV: ")
String errorInImportCSV();
}

View File

@ -8,6 +8,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
@ -15,6 +16,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -36,20 +38,19 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
*/
public class CSVOperationInProgressCard extends WizardCard implements
MonitorDialogListener {
@SuppressWarnings("unused")
private CSVOperationInProgressCard thisCard;
private static CommonMessages msgsCommon=GWT.create(CommonMessages.class);
private CSVImportWizardTDMessages msgs;
private CSVImportSession importSession;
private TRId newTrId;
private HtmlLayoutContainer resultField;
private AutoProgressBar storageLoading;
public CSVOperationInProgressCard(final CSVImportSession importSession) {
super("Operation In Progress", "");
super(msgsCommon.operationInProgress(), "");
this.importSession = importSession;
thisCard = this;
initMessages();
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
//operationInProgressPanel.setHeight(390);
@ -62,18 +63,18 @@ public class CSVOperationInProgressCard extends WizardCard implements
// display:block;vertical-align:text-top;
description.setHTML(0, 0,
"<span style=\"font-weight:bold;\";>Document: </span>");
description.setText(0, 1, "CSV File");
"<span style=\"font-weight:bold;\";>"+msgs.csvOperationInProgressDocumentLabel()+"</span>");
description.setText(0, 1, msgs.csvOperationInProgressCSVFile());
description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>Source: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.csvOperationInProgressSourceLabel()+"</span>");
description.setText(1, 1, importSession.getSource().getName());
description.setHTML(2, 0,
"<span style=\"font-weight:bold;\";>File: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.csvOperationInProgressFileLabel()+"</span>");
description.setText(2, 1, importSession.getTabResource().getName());
FramedPanel summary = new FramedPanel();
summary.setHeadingText("Import Summary");
summary.setHeadingText(msgs.summaryImport());
summary.setWidth(400);
summary.add(description);
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
@ -96,12 +97,16 @@ public class CSVOperationInProgressCard extends WizardCard implements
}
protected void initMessages() {
msgs = GWT.create(CSVImportWizardTDMessages.class);
}
public void importCSV() {
//mask("Loading on Storage...");
storageLoading.setVisible(true);
forceLayout();
storageLoading.updateText("Loading on Storage...");
storageLoading.updateText(msgsCommon.loadingOnStorage());
storageLoading.redraw();
storageLoading.auto();
@ -125,8 +130,8 @@ public class CSVOperationInProgressCard extends WizardCard implements
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide(
"Error in importCSV",
"An error occured in importCSV: ",
msgsCommon.error(),
msgs.errorInImportCSV(),
caught.getLocalizedMessage(),
caught);
}
@ -155,7 +160,7 @@ public class CSVOperationInProgressCard extends WizardCard implements
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>");
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>"+msgsCommon.operationCompleted()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
@ -184,7 +189,7 @@ public class CSVOperationInProgressCard extends WizardCard implements
public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>");
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color:red;'>"+msgsCommon.operationFailed()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
if (caught instanceof TDGWTSessionExpiredException) {
@ -203,7 +208,7 @@ public class CSVOperationInProgressCard extends WizardCard implements
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>Problems in the Operation</div>");
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>"+msgsCommon.operationProblem()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@ -234,7 +239,7 @@ public class CSVOperationInProgressCard extends WizardCard implements
public void operationAborted() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>Operation Aborted</div>");
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>"+msgsCommon.operationAborted()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@ -264,7 +269,7 @@ public class CSVOperationInProgressCard extends WizardCard implements
public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>Operation in Background</div>");
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>"+msgsCommon.operationInBackground()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);

View File

@ -65,6 +65,8 @@ public class CSVUploadFileCard extends WizardCard {
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setEnableNextButton(false);
setNextButtonVisible(true);
setBackButtonVisible(true);
}
}

View File

@ -161,6 +161,8 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setEnableNextButton(false);
setNextButtonVisible(true);
setBackButtonVisible(true);
}

View File

@ -146,9 +146,11 @@ public class SourceSelectionCard extends WizardCard {
}
}
};
getWizardWindow().setNextButtonCommand(sayNextCard);
setNextButtonVisible(true);
setBackButtonVisible(false);
}
}

View File

@ -60,3 +60,9 @@ btnCancelText = Cancel
csvFileMissingHead = CSV file missing
csvFileMissing = Please specify a CSV file
errorUploadingCSVFileHead = Error uploading the csv file
csvOperationInProgressDocumentLabel = Document:
csvOperationInProgressSourceLabel = Source:
csvOperationInProgressFileLabel = File:
summaryImport = Import Summary
csvOperationInProgressCSVFile = CSV File
errorInImportCSV = An error occured in import CSV:

View File

@ -60,3 +60,9 @@ btnCancelText = Anular
csvFileMissingHead = CSV archivo que falta
csvFileMissing = Especifica el archivo CSV
errorUploadingCSVFileHead = Error cargando el archivo CSV
csvOperationInProgressDocumentLabel = Documento:
csvOperationInProgressSourceLabel = Fuente:
csvOperationInProgressFileLabel = Archivo:
summaryImport = Resumen de Importación
csvOperationInProgressCSVFile = CSV Archivo
errorInImportCSV = Se ha producido un error en la importación CSV:

View File

@ -60,3 +60,10 @@ btnCancelText = Cancella
csvFileMissingHead = CSV file non trovato
csvFileMissing = Specifica un file CSV
errorUploadingCSVFileHead = Errore caricando il file csv
csvOperationInProgressDocumentLabel = Documento:
csvOperationInProgressSourceLabel = Sorgente:
csvOperationInProgressFileLabel = File:
summaryImport = Sommario Importazione
csvOperationInProgressCSVFile = CSV File
errorInImportCSV = Un errore è avvenuto nell''importazione CSV: