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-codelistmapping-import-widget@120198 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-11-05 17:00:21 +00:00
parent 5ad6df5ea4
commit 1b6e7c019e
14 changed files with 306 additions and 114 deletions

View File

@ -27,18 +27,27 @@ import com.sencha.gxt.widget.core.client.form.TextField;
*/
public class CodelistMappingUrlSelectionCard extends WizardCard {
private static CodelistMappingMessages msgs= GWT.create(CodelistMappingMessages.class);
private CommonMessages msgsCommon;
private CodelistMappingSession codelistMappingSession;
private CodelistMappingUrlSelectionCard thisCard;
private TextField urlField;
private CommonMessages msgsCommon;
public CodelistMappingUrlSelectionCard(
final CodelistMappingSession codelistMappingSession) {
super(msgs.codelistMappingUrlSelectionCardHead(), "");
this.thisCard = this;
this.codelistMappingSession = codelistMappingSession;
initMessages();
create();
}
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
protected void create(){
FramedPanel form = new FramedPanel();
form.setHeaderVisible(false);
form.setBodyBorder(false);
@ -54,11 +63,6 @@ public class CodelistMappingUrlSelectionCard extends WizardCard {
v.add(new FieldLabel(urlField, msgs.urlFieldLabel()), new VerticalLayoutData(1, -1));
setContent(form);
}
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
protected void checkUrl() {

View File

@ -41,6 +41,15 @@ public class SourceSelectionCard extends WizardCard {
super(msgs.sourceSelectionCardHead(), "");
this.codelistMappingSession = codelistMappingSession;
initMessages();
create();
}
protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class);
}
protected void create(){
// Default
codelistMappingSession.setSource(urlSource);
@ -121,9 +130,6 @@ public class SourceSelectionCard extends WizardCard {
}
protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class);
}
@Override
public void setup() {

View File

@ -28,8 +28,8 @@ import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TabResourcesSelectionCard extends WizardCard {
@ -46,7 +46,15 @@ public class TabResourcesSelectionCard extends WizardCard {
Log.debug("TabResourcesSelectionCard");
this.codelistMappingSession = codelistMappingSession;
thisCard = this;
initMessages();
create();
}
protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class);
}
protected void create() {
tabResourcesSelectionPanel = new TabResourcesSelectionPanel(thisCard,
res);
@ -66,10 +74,6 @@ public class TabResourcesSelectionCard extends WizardCard {
}
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
@Override
public void setup() {
Log.debug("TabResourcesSelectionCard Call Setup ");
@ -119,7 +123,8 @@ public class TabResourcesSelectionCard extends WizardCard {
} else {
Log.debug("Attention",
"This tabular resource does not have a valid table");
AlertMessageBox d = new AlertMessageBox(msgsCommon.attention(),
AlertMessageBox d = new AlertMessageBox(
msgsCommon.attention(),
msgs.attentionThisTabularResourceDoesNotHaveAValidTable());
d.addHideHandler(new HideHandler() {

View File

@ -93,7 +93,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
try {
createContextMenu();
buildPanel();
createPanel();
} catch (Throwable e) {
Log.debug("Error building panel:" + e.getMessage());
@ -113,7 +113,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
}
protected void buildPanel() {
protected void createPanel() {
ToolBar toolBar = new ToolBar();
toolBar.add(new LabelToolItem(msgsCommon.toolItemSearchLabel()));

View File

@ -73,7 +73,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
this.trId = trId;
initMessages();
initPanel();
create();
createPanel();
}
@ -87,7 +87,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
// setHeadingText("Columns");
}
protected void create() {
protected void createPanel() {
ColumnConfig<ColumnData, String> labelColumn = new ColumnConfig<ColumnData, String>(
props.label(), 120, msgs.labelColumn());

View File

@ -7,6 +7,12 @@ import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ColumnDataProperties extends PropertyAccess<ColumnData> {
@Path("id")

View File

@ -5,6 +5,7 @@ package org.gcube.portlets.user.td.codelistmappingimportwidget.client.progress;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
import com.sencha.gxt.widget.core.client.ProgressBar;
/**
@ -15,8 +16,8 @@ import com.sencha.gxt.widget.core.client.ProgressBar;
*
*/
public class FileUploadProgressBarUpdater implements FileUploadProgressListener {
protected ProgressBar progressBar;
private static FileUploadProgressMessages msgs = GWT.create(FileUploadProgressMessages.class);
private ProgressBar progressBar;
/**
* Creates a new {@link ProgressBar} updater.
@ -24,16 +25,18 @@ public class FileUploadProgressBarUpdater implements FileUploadProgressListener
*/
public FileUploadProgressBarUpdater(ProgressBar progressBar) {
this.progressBar = progressBar;
this.progressBar.updateProgress(0, "Please Wait...");
this.progressBar.updateProgress(0, msgs.pleaseWait());
}
/**
* {@inheritDoc}
*/
public void operationComplete() {
Log.info("File upload complete");
progressBar.updateProgress(1, "File upload completed.");
progressBar.updateProgress(1, msgs.fileUploadCompleted());
}
@ -42,12 +45,12 @@ public class FileUploadProgressBarUpdater implements FileUploadProgressListener
*/
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("File upload failed");
progressBar.updateText("File upload failed.");
progressBar.updateText(msgs.fileUploadFailed());
}
public void operationInitializing() {
Log.info("File upload inizializing");
progressBar.updateProgress(0, "Initializing...");
progressBar.updateProgress(0, msgs.initializing());
}
public void operationUpdate(float elaborated) {
@ -55,9 +58,9 @@ public class FileUploadProgressBarUpdater implements FileUploadProgressListener
if (elaborated>=0 && elaborated<1) {
Log.trace("progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% Uploading...");
progressBar.updateProgress(elaborated,elab+msgs.percUploading());
}
if (elaborated == 1) progressBar.updateProgress(1, "Completed.");
if (elaborated == 1) progressBar.updateProgress(1, msgs.fileUploadCompleted());
}

View File

@ -9,21 +9,25 @@ import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.file.FileUploadMonitor;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* This {@link Timer} retrieves {@link OperationProgress} from the specified {@link OperationProgressSource} with the scheduled interval.
* The retrieved information are spread to the subscribed {@link CodelistMappingImportProgressListener}.
* This {@link Timer} retrieves {@link OperationProgress} from the specified
* {@link OperationProgressSource} with the scheduled interval. The retrieved
* information are spread to the subscribed
* {@link CodelistMappingImportProgressListener}.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class FileUploadProgressUpdater extends Timer {
protected ArrayList<FileUploadProgressListener> listeners = new ArrayList<FileUploadProgressListener>();
private ArrayList<FileUploadProgressListener> listeners = new ArrayList<FileUploadProgressListener>();
private static FileUploadProgressMessages msgs = GWT
.create(FileUploadProgressMessages.class);
/**
* {@inheritDoc}
@ -31,30 +35,38 @@ public class FileUploadProgressUpdater extends Timer {
@Override
public void run() {
Log.debug("requesting operation progress");
TDGWTServiceAsync.INSTANCE.getFileUploadMonitor(new AsyncCallback<FileUploadMonitor>() {
TDGWTServiceAsync.INSTANCE
.getFileUploadMonitor(new AsyncCallback<FileUploadMonitor>() {
public void onFailure(Throwable caught) {
cancel();
Log.error("Error retrieving the operation state", caught);
Log.error("Error retrieving the operation state",
caught);
String message = getStack(caught);
fireOperationFailed(caught, "Failed getting operation updates", message);
fireOperationFailed(caught,
msgs.failedGettingOperarionUpdateds(), message);
}
public void onSuccess(FileUploadMonitor result) {
Log.info("retrieved FileUploadMonitor: "+result.getState());
Log.info("retrieved FileUploadMonitor: "
+ result.getState());
switch (result.getState()) {
case STARTED:
Log.debug("File Upload Started");
break;
case INPROGRESS:
Log.debug("Progress: "+result.getElaboratedLenght()+" of "+result.getTotalLenght());
Log.debug("Progress: "
+ result.getElaboratedLenght() + " of "
+ result.getTotalLenght());
fireOperationUpdate(result.getPercentDone());
break;
case FAILED:
Log.debug("File Upload Failed");
cancel();
fireOperationFailed(new Throwable("File Upload Failed") ,result.getFailureReason(), result.getFailureDetails());
fireOperationFailed(
new Throwable(msgs.fileUploadFailedHead()),
result.getFailureReason(),
result.getFailureDetails());
break;
case COMPLETED:
cancel();
@ -67,61 +79,58 @@ public class FileUploadProgressUpdater extends Timer {
}
});
}
protected String getStack(Throwable e)
{
String message = e.getLocalizedMessage()+" -> <br>";
protected String getStack(Throwable e) {
String message = e.getLocalizedMessage() + " -> <br>";
Throwable c = e.getCause();
if (c!=null) message += getStack(c);
if (c != null)
message += getStack(c);
return message;
}
protected void fireOperationInitializing()
{
for (FileUploadProgressListener listener:listeners) listener.operationInitializing();
protected void fireOperationInitializing() {
for (FileUploadProgressListener listener : listeners)
listener.operationInitializing();
}
protected void fireOperationUpdate(float elaborated)
{
for (FileUploadProgressListener listener:listeners) listener.operationUpdate(elaborated);
protected void fireOperationUpdate(float elaborated) {
for (FileUploadProgressListener listener : listeners)
listener.operationUpdate(elaborated);
}
protected void fireOperationComplete()
{
for (FileUploadProgressListener listener:listeners) listener.operationComplete();
protected void fireOperationComplete() {
for (FileUploadProgressListener listener : listeners)
listener.operationComplete();
}
protected void fireOperationFailed(Throwable caught, String failure, String failureDetails)
{
for (FileUploadProgressListener listener:listeners) listener.operationFailed(caught, failure, failureDetails);
protected void fireOperationFailed(Throwable caught, String failure,
String failureDetails) {
for (FileUploadProgressListener listener : listeners)
listener.operationFailed(caught, failure, failureDetails);
}
/**
* Add a new {@link CodelistMappingImportProgressListener} to this {@link FileUploadProgressUpdater}.
* @param listener the listener to add.
* Add a new {@link CodelistMappingImportProgressListener} to this
* {@link FileUploadProgressUpdater}.
*
* @param listener
* the listener to add.
*/
public void addListener(FileUploadProgressListener listener)
{
public void addListener(FileUploadProgressListener listener) {
listeners.add(listener);
}
/**
* Removes the specified {@link CodelistMappingImportProgressListener} from this {@link FileUploadProgressUpdater}.
* @param listener the listener to remove.
* Removes the specified {@link CodelistMappingImportProgressListener} from
* this {@link FileUploadProgressUpdater}.
*
* @param listener
* the listener to remove.
*/
public void removeListener(FileUploadProgressListener listener)
{
public void removeListener(FileUploadProgressListener listener) {
listeners.remove(listener);
}
}

View File

@ -0,0 +1,45 @@
codelistMappingImportWizardHead = Codelist Mapping Import
sourceSelectionCardHead = Codelist Mapping source selection
codelistMappingUploadFileCardHead = Codelist Mapping Import File Upload
tabResourcesSelectionCardHead = Select the Codelist before curation
attentionThisTabularResourceDoesNotHaveAValidTable = This tabular resource does not have a valid table!
delete = Delete
wouldYouLikeToDeleteThisTabularResourceWithoutTable = Would you like to delete this tabular resource without table?
errorOnDeleteTabularResourceFixed = Error on delete Tabular Resource:
columnSelectionCardHead = Select The Code Column
attentionNoColumnsSelected = No column selected!
codelistMappingDetailCardHead = Codelist Mapping Detail
fieldNameEmptyText = Enter a name...
fieldNameLabel = Name
fieldDescriptionEmptyText = Enter a description...
fieldDescriptionLabel = Description
fieldDescriptionDefaultValue = XML map
attentionFillInAllFields = Fill in all fields!
documentFixed = Document:
sourceFixed = Source:
nameFixed = Name:
summaryImport = Import Summary
errorAnErrorOccurredInImportCodelistMappingFixed = An error occured in import codelist mapping:
errorInCodelistMappingImportHead = Error in Codelist Mapping Import
selectTheFileToImport = Select the file to import
btnUploadText = Upload
btnCancelText = Cancel
attentionSpecifyAXmlFile = Please, specify a XML file!
errorUploadingTheXMLFileHead = Error uploading the xml file
codelistMappingUrlSelectionCardHead = Codelist Mapping Url Selection
urlFieldEmptyText = Insert a valid url...
urlFieldLabel = Url
codelistMappingWorkSpaceSelectionCardHead = CSV Import From Workspace
workspaceExplorerSelectPanelHead = Workspace Selection
errorRetrievingTheFileFromWorkspaceFixed = Error retrieving the file from the workspace:
nameColumn = Name
typeColumn = Type
tableTypeColumn = Table Type
agencyColumn = Agency
ownerColumn = Owner
creationDateColumn = Creation Date
deleteItem = Delete
errorRetrievingTabularResourceFixed = Error retrieving tabular resources on server:
wouldYouLikeToDeleteThisTabularResource = Would you like to delete this tabular resource?
labelColumn = Column
errorNoLoadColumnsFixed = No load column:

View File

@ -0,0 +1,45 @@
codelistMappingImportWizardHead = Importar Mapa para la Codelist
sourceSelectionCardHead = Seleccionar la fuente
codelistMappingUploadFileCardHead = Importar el archivo de Mapa
tabResourcesSelectionCardHead = Seleccione la Codelist antes la Curation
attentionThisTabularResourceDoesNotHaveAValidTable = Esta tabular resource no tiene una tabla válida!
delete = Borrar
wouldYouLikeToDeleteThisTabularResourceWithoutTable = Usted quiere eliminar esta tabular resource que no tiene una tabla válida?
errorOnDeleteTabularResourceFixed = Error al eliminar la Tabular Resource:
columnSelectionCardHead = Seleccionar la columna Code
attentionNoColumnsSelected = No columna seleccionada!
codelistMappingDetailCardHead = Detalle Mapa
fieldNameEmptyText = Entrar un nombre...
fieldNameLabel = Nombre
fieldDescriptionEmptyText = Entrar una descripción...
fieldDescriptionLabel = Descripción
fieldDescriptionDefaultValue = Mapa XML
attentionFillInAllFields = Por favor entrar todos los campos!
documentFixed = Documento:
sourceFixed = Fuente:
nameFixed = Nombre:
summaryImport = Resumen Importación
errorAnErrorOccurredInImportCodelistMappingFixed = Error al importar el mapa:
errorInCodelistMappingImportHead = Error al importar el mapa
selectTheFileToImport = Seleccionar el archivo a importar
btnUploadText = Cargar
btnCancelText = Anular
attentionSpecifyAXmlFile = Atención, seleccionar un archivo XML!
errorUploadingTheXMLFileHead = Error en cargando el archivo XML
codelistMappingUrlSelectionCardHead = Importar Mapa Seleccionar Url
urlFieldEmptyText = Entrar una URL válida...
urlFieldLabel = Url
codelistMappingWorkSpaceSelectionCardHead = Importar CSV desde el Workspace
workspaceExplorerSelectPanelHead = Seleccionar en el Workspace
errorRetrievingTheFileFromWorkspaceFixed = Error al recuperar el archivo desde el workspace:
nameColumn = Nombre
typeColumn = Tipo
tableTypeColumn = Tipo Tabla
agencyColumn = Agencia
ownerColumn = Propietario
creationDateColumn = Fecha Creacion
deleteItem = Borrar
errorRetrievingTabularResourceFixed = Error al recuperar la tabular resource desde el servidor:
wouldYouLikeToDeleteThisTabularResource = Usted está seguro de borrar esta tabular resource?
labelColumn = Columna
errorNoLoadColumnsFixed = Ninguna columna cargada:

View File

@ -0,0 +1,45 @@
codelistMappingImportWizardHead = Importa Mappa per la Codelist
sourceSelectionCardHead = Seleziona la sorgente
codelistMappingUploadFileCardHead = Importa il file della Mappa
tabResourcesSelectionCardHead = Seleziona la Codelist prima della Curation
attentionThisTabularResourceDoesNotHaveAValidTable = Questa tabular resource non ha una tabella valida!
delete = Elimina
wouldYouLikeToDeleteThisTabularResourceWithoutTable = Si desidera eliminare questa tabular resource che non ha una tabella valida?
errorOnDeleteTabularResourceFixed = Errore eliminando la Tabular Resource:
columnSelectionCardHead = Seleziona la colonna Code
attentionNoColumnsSelected = Nessuna colonna selezionata!
codelistMappingDetailCardHead = Dettaglio della Mappa
fieldNameEmptyText = Inserisci un nome...
fieldNameLabel = Nome
fieldDescriptionEmptyText = Inserisci una descrizione...
fieldDescriptionLabel = Descrizione
fieldDescriptionDefaultValue = Mappa XML
attentionFillInAllFields = Riempi tutti i campi!
documentFixed = Documento:
sourceFixed = Sorgente:
nameFixed = Nome:
summaryImport = Sommario Importazione
errorAnErrorOccurredInImportCodelistMappingFixed = Un errore è stato generato nell''operazione di import della mappa:
errorInCodelistMappingImportHead = Errore nel Import della Mappa
selectTheFileToImport = Seleziona il file da importare
btnUploadText = Caricare
btnCancelText = Cancella
attentionSpecifyAXmlFile = Attenzione, specifica un file XML!
errorUploadingTheXMLFileHead = Errore caricando il file xml
codelistMappingUrlSelectionCardHead = Importa Mappa Seleziona Url
urlFieldEmptyText = Inserisci un url valida...
urlFieldLabel = Url
codelistMappingWorkSpaceSelectionCardHead = Importa il CSV dal Workspace
workspaceExplorerSelectPanelHead = Seleziona nel Workspace
errorRetrievingTheFileFromWorkspaceFixed = Errore recuperando il file dal Workspace:
nameColumn = Nome
typeColumn = Tipo
tableTypeColumn = Tipo Tabella
agencyColumn = Agenzia
ownerColumn = Proprietario
creationDateColumn = Data Creazione
deleteItem = Elimina
errorRetrievingTabularResourceFixed = Errore recuperando la tabular resources dal server:
wouldYouLikeToDeleteThisTabularResource = Si deisdera eliminare questa tabular resource?
labelColumn = Colonna
errorNoLoadColumnsFixed = Nessuna colonna caricata:

View File

@ -0,0 +1,8 @@
pleaseWait = Please Wait...
fileUploadCompleted = File upload completed.
fileUploadFailedHead = File Upload Failed
fileUploadFailed = File upload failed.
initializing = Initializing...
percUploading = % Uploading...
completing = Completing...
failedGettingOperarionUpdateds = Failed getting operation updates

View File

@ -0,0 +1,8 @@
pleaseWait = Por Favor, Espera...
fileUploadCompleted = Carga de archivo completada.
fileUploadFailedHead = Carga de Archivo Fallido
fileUploadFailed = Carga de archivos fallido.
initializing = Inicialización...
percUploading = % Cargando...
completing = Completar...
failedGettingOperarionUpdateds = Error al recuperar información sobre la operación

View File

@ -0,0 +1,8 @@
pleaseWait = Attendere...
fileUploadCompleted = Caricamento file completato.
fileUploadFailedHead = Caricamento File Fallito
fileUploadFailed = Caricamento file fallito.
initializing = Inizzializazione...
percUploading = % Carimento...
completing = Completamento...
failedGettingOperarionUpdateds = Errore recuperando informazioni sull''operazione