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-open-widget@119947 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-21 16:40:29 +00:00 committed by Giancarlo Panichi
parent 13418b7b40
commit 7f9e174ab2
7 changed files with 60 additions and 36 deletions

View File

@ -16,12 +16,6 @@ public interface TDOpenMessages extends Messages {
@DefaultMessage("Select a Tabular Resource")
String tabResourcesSelectionCardSelectLabel();
@DefaultMessage("Search")
String buttonSearchLabel();
@DefaultMessage("Reload")
String buttonReloadLabel();
@DefaultMessage("Name")
String tabResourcesSelectionPanelColumnNameLabel();
@ -50,5 +44,14 @@ public interface TDOpenMessages extends Messages {
@DefaultMessage("Info")
String tabResourcesSelectionPanelContextMenuInfo();
@DefaultMessage("Tabular Resource is locked no info available!")
String attentionTabularResourceIsLockedNoInfoAvailable();
@DefaultMessage("Delete")
String deleteHead();
@DefaultMessage("Would you like to delete this tabular resource?")
String questionWouldYouLikeToDeleteThisTabularResource();
}

View File

@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedExcep
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.openwidget.client.resources.ResourceBundleTDOpen;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
@ -88,8 +89,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
}
private CommonMessages msgsCommon;
private TDOpenMessages msgs;
private Grid<TabResource> grid;
private ResourceBundle res;
private Menu contextMenu;
@ -97,16 +99,18 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
private TabResource removableTR;
private TabResourcesSelectionCard parent;
private TDOpenMessages msgsTDOpen;
public TabResourcesSelectionPanel(TabResourcesSelectionCard parent,
ResourceBundle res) {
this.res = res;
this.parent = parent;
this.msgsTDOpen = GWT.create(TDOpenMessages.class);
Log.debug("TabResourcesSelectionPanel");
init();
initMessages();
initWindow();
try {
createContextMenu();
} catch (Throwable e) {
@ -121,22 +125,27 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
e.printStackTrace();
}
}
protected void initMessages(){
msgs = GWT.create(TDOpenMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void init() {
protected void initWindow() {
setHeaderVisible(false);
}
protected void buildPanel() {
ToolBar toolBar = new ToolBar();
toolBar.add(new LabelToolItem(msgsTDOpen.buttonSearchLabel()+": "));
toolBar.add(new LabelToolItem(msgsCommon.toolItemSearchLabel()));
final TextField searchField = new TextField();
toolBar.add(searchField);
TextButton btnReload = new TextButton();
// btnReload.setText("Reload");
btnReload.setIcon(res.refresh16());
btnReload.setToolTip(msgsTDOpen.buttonReloadLabel());
btnReload.setToolTip(msgsCommon.toolItemReloadLabel());
toolBar.add(btnReload);
IdentityValueProvider<TabResource> identity = new IdentityValueProvider<TabResource>();
@ -171,19 +180,19 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
store.setEnableFilters(true);
ColumnConfig<TabResource, String> nameColumn = new ColumnConfig<TabResource, String>(
properties.name(), 90, msgsTDOpen.tabResourcesSelectionPanelColumnNameLabel());
properties.name(), 90, msgs.tabResourcesSelectionPanelColumnNameLabel());
ColumnConfig<TabResource, String> typeColumn = new ColumnConfig<TabResource, String>(
properties.tabResourceType(), 30, msgsTDOpen.tabResourcesSelectionPanelColumnTypeLabel());
properties.tabResourceType(), 30, msgs.tabResourcesSelectionPanelColumnTypeLabel());
ColumnConfig<TabResource, String> tableTypeNameColumn = new ColumnConfig<TabResource, String>(
properties.tableTypeName(), 30, msgsTDOpen.tabResourcesSelectionPanelColumnTableTypeLabel());
properties.tableTypeName(), 30, msgs.tabResourcesSelectionPanelColumnTableTypeLabel());
ColumnConfig<TabResource, Boolean> lockedColumn = new ColumnConfig<TabResource, Boolean>(
properties.locked(), 20, msgsTDOpen.tabResourcesSelectionPanelColumnLockLabel());
properties.locked(), 20, msgs.tabResourcesSelectionPanelColumnLockLabel());
ColumnConfig<TabResource, String> agencyColumn = new ColumnConfig<TabResource, String>(
properties.agency(), 60, msgsTDOpen.tabResourcesSelectionPanelColumnAgencyLabel());
properties.agency(), 60, msgs.tabResourcesSelectionPanelColumnAgencyLabel());
ColumnConfig<TabResource, String> ownerColumn = new ColumnConfig<TabResource, String>(
properties.ownerLogin(), 70, msgsTDOpen.tabResourcesSelectionPanelColumnOwnerLabel());
properties.ownerLogin(), 70, msgs.tabResourcesSelectionPanelColumnOwnerLabel());
ColumnConfig<TabResource, Date> dateColumn = new ColumnConfig<TabResource, Date>(
properties.date(), 50, msgsTDOpen.tabResourcesSelectionPanelColumnCreationDateLabel());
properties.date(), 50, msgs.tabResourcesSelectionPanelColumnCreationDateLabel());
dateColumn.setCell(new DateCell(sdf));
@ -299,7 +308,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
protected void createContextMenu() {
contextMenu = new Menu();
MenuItem deleteTRItem = new MenuItem(msgsTDOpen.tabResourcesSelectionPanelContextMenuDelete());
MenuItem deleteTRItem = new MenuItem(msgs.tabResourcesSelectionPanelContextMenuDelete());
deleteTRItem.setId("DeleteTR");
deleteTRItem.setIcon(ResourceBundleTDOpen.INSTANCE.delete());
deleteTRItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -316,7 +325,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
contextMenu.add(deleteTRItem);
MenuItem infoItem = new MenuItem();
infoItem.setText(msgsTDOpen.tabResourcesSelectionPanelContextMenuInfo());
infoItem.setText(msgs.tabResourcesSelectionPanelContextMenuInfo());
infoItem.setIcon(ResourceBundleTDOpen.INSTANCE.information());
infoItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -342,8 +351,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
protected void requestInfo(TabResource tabResource) {
if (tabResource.isLocked()) {
UtilsGXT3.alert("Attention",
"Tabular Resource is locked no info available!");
UtilsGXT3.alert(msgsCommon.attention(),
msgs.attentionTabularResourceIsLockedNoInfoAvailable());
return;
}
@ -365,14 +374,14 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
if (caught instanceof TDGWTIsLockedException) {
Log.error("Tabular Resource is Locked: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide("Error",
parent.showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "",
caught);
} else {
Log.error("Error: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide("Error",
parent.showErrorAndHide(msgsCommon.error(),
caught.getLocalizedMessage(), "",
caught);
@ -418,7 +427,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
} else {
Log.error("Error retrieving tabular resource: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide("Error",
parent.showErrorAndHide(msgsCommon.error(),
caught.getLocalizedMessage(), "", caught);
}
callback.onFailure(caught);
@ -471,8 +480,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
protected void deleteTR(TabResource tabResource) {
removableTR = tabResource;
final ConfirmMessageBox mb = new ConfirmMessageBox("Delete",
"Would you like to delete this tabular resource?");
final ConfirmMessageBox mb = new ConfirmMessageBox(msgs.deleteHead(),
msgs.questionWouldYouLikeToDeleteThisTabularResource());
// Next in GXT 3.1.1
mb.addDialogHideHandler(new DialogHideHandler() {
@ -519,13 +528,13 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
Log.error("Error on delete TabResource: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
UtilsGXT3.alert(msgsCommon.error(),
caught.getLocalizedMessage());
}
}

View File

@ -8,5 +8,9 @@ tabResourcesSelectionPanelColumnTableTypeLabel = Table Type
tabResourcesSelectionPanelColumnLockLabel = Lock
tabResourcesSelectionPanelColumnAgencyLabel = Agency
tabResourcesSelectionPanelColumnOwnerLabel = Owner
tabResourcesSelectionPanelColumnCreationDateLabel = Creation Date
tabResourcesSelectionPanelContextMenuDelete = Delete
tabResourcesSelectionPanelContextMenuInfo = Info
attentionTabularResourceIsLockedNoInfoAvailable = Tabular Resource is locked no info available!
deleteHead = Delete
questionWouldYouLikeToDeleteThisTabularResource = Would you like to delete this tabular resource?

View File

@ -8,5 +8,9 @@ tabResourcesSelectionPanelColumnTableTypeLabel = Tipo Tabla
tabResourcesSelectionPanelColumnLockLabel = Lock
tabResourcesSelectionPanelColumnAgencyLabel = Agencia
tabResourcesSelectionPanelColumnOwnerLabel = Propietario
tabResourcesSelectionPanelColumnCreationDateLabel = Fecha Creacion
tabResourcesSelectionPanelContextMenuDelete = Borrar
tabResourcesSelectionPanelContextMenuInfo = Información
attentionTabularResourceIsLockedNoInfoAvailable = La Tabular Resource es locked no hay información disponible!
deleteHead = Borrar
questionWouldYouLikeToDeleteThisTabularResource = Seguro que quieres eliminar esta Tabular Resource?

View File

@ -7,6 +7,10 @@ tabResourcesSelectionPanelColumnTypeLabel = Tipo
tabResourcesSelectionPanelColumnTableTypeLabel = Tipo Tabella
tabResourcesSelectionPanelColumnLockLabel = Lock
tabResourcesSelectionPanelColumnAgencyLabel = Agenzia
tabResourcesSelectionPanelColumnOwnerLabel = Propietario
tabResourcesSelectionPanelColumnOwnerLabel = Proprietario
tabResourcesSelectionPanelColumnCreationDateLabel = Data Creazione
tabResourcesSelectionPanelContextMenuDelete = Elimina
tabResourcesSelectionPanelContextMenuInfo = Informazioni
attentionTabularResourceIsLockedNoInfoAvailable = La Tabular Resource è locked nessuna informazione disponibile!
deleteHead = Elimina
questionWouldYouLikeToDeleteThisTabularResource = Sei sicuro di voler eliminare questa Tabular Resource?

View File

@ -17,7 +17,7 @@ rightLabel = Rights
rightLabelToolTip = Rights
validFromLabel = Valid From
validFromLabelToolTip = Valid From
validUntilToLabel = valid Until To
validUntilToLabel = Valid Until To
validUntilToLabelToolTip = Valid Until To
licencesLabel = Licence
licencesLabelToolTip = Licence

View File

@ -17,8 +17,8 @@ rightLabel = Derechos
rightLabelToolTip = Derechos
validFromLabel = Válida Desde
validFromLabelToolTip = Válida Desde
validUntilToLabel = Válido Hasta
validUntilToLabelToolTip = Válido Hasta
validUntilToLabel = Válida Hasta
validUntilToLabelToolTip = Válida Hasta
licencesLabel = Licencia
licencesLabelToolTip = Licencia
ownerLabel = Propietario