From 80984350d0138db888a0e2d0b01a9605cd91af39 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 8 Apr 2015 11:12:38 +0000 Subject: [PATCH] Updated i18n support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@113895 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/td/client/ribbon/ModifyToolBar.java | 75 ++++++------ .../client/ribbon/ModifyToolBarMessages.java | 111 ++++++++++++++++++ .../ribbon/ModifyToolBarMessages.properties | 32 +++++ .../ModifyToolBarMessages_es.properties | 32 +++++ .../ModifyToolBarMessages_it.properties | 32 +++++ 5 files changed, 246 insertions(+), 36 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.java create mode 100644 src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_es.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_it.properties diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBar.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBar.java index 2a82608..15e4ab9 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBar.java +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBar.java @@ -10,6 +10,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType; import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType; import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NodeList; import com.google.gwt.event.logical.shared.SelectionEvent; @@ -70,10 +71,12 @@ public class ModifyToolBar { private MenuItem deleteSelectedRowsItem; private MenuItem deleteDuplicateItem; - private MenuItem deleteByExpression; + private MenuItem deleteByExpressionItem; + private ModifyToolBarMessages msgs; public ModifyToolBar(EventBus eventBus) { this.eventBus = eventBus; + msgs = GWT.create(ModifyToolBarMessages.class); build(); } @@ -90,31 +93,31 @@ public class ModifyToolBar { ButtonGroup rowsGroup = new ButtonGroup(); rowsGroup.setId("Rows"); rowsGroup.setStyleName("ribbon"); - rowsGroup.setHeadingText("Rows"); + rowsGroup.setHeadingText(msgs.rowsGroupHeadingText()); rowsGroup.enable(); toolBar.add(rowsGroup); FlexTable rowsLayout = new FlexTable(); rowsGroup.add(rowsLayout); - replaceButton = new TextButton("Replace", + replaceButton = new TextButton(msgs.replaceButton(), TabularDataResources.INSTANCE.tableReplaceRows32()); replaceButton.disable(); replaceButton.setScale(ButtonScale.LARGE); replaceButton.setIconAlign(IconAlign.TOP); - replaceButton.setToolTip("Replace rows"); + replaceButton.setToolTip(msgs.replaceButtonToolTip()); replaceButton.setArrowAlign(ButtonArrowAlign.RIGHT); replaceButton.setMenu(createReplaceMenu()); rowsLayout.setWidget(0, 0, replaceButton); rowsLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); - deleteButton = new TextButton("Delete", + deleteButton = new TextButton(msgs.deleteButton(), TabularDataResources.INSTANCE.tableRowDelete32()); deleteButton.disable(); deleteButton.setScale(ButtonScale.LARGE); deleteButton.setIconAlign(IconAlign.TOP); - deleteButton.setToolTip("Delete rows"); + deleteButton.setToolTip(msgs.deleteButtonToolTip()); deleteButton.setArrowAlign(ButtonArrowAlign.RIGHT); deleteButton.setMenu(createDeleteMenu()); @@ -122,12 +125,12 @@ public class ModifyToolBar { rowsLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); - addRowButton = new TextButton("Add", + addRowButton = new TextButton(msgs.addRowButton(), TabularDataResources.INSTANCE.rowInsert32()); addRowButton.disable(); addRowButton.setScale(ButtonScale.LARGE); addRowButton.setIconAlign(IconAlign.TOP); - addRowButton.setToolTip("Add row"); + addRowButton.setToolTip(msgs.addRowButtonToolTip()); addRowButton.setArrowAlign(ButtonArrowAlign.BOTTOM); addRowButton.addSelectHandler(new SelectHandler() { @@ -140,12 +143,12 @@ public class ModifyToolBar { rowsLayout.getFlexCellFormatter().setRowSpan(0, 2, 2); - filterButton = new TextButton("Filter", + filterButton = new TextButton(msgs.filterButton(), TabularDataResources.INSTANCE.filter32()); filterButton.disable(); filterButton.setScale(ButtonScale.LARGE); filterButton.setIconAlign(IconAlign.TOP); - filterButton.setToolTip("Filter rows"); + filterButton.setToolTip(msgs.filterButtonToolTip()); filterButton.setArrowAlign(ButtonArrowAlign.BOTTOM); filterButton.addSelectHandler(new SelectHandler() { @@ -164,19 +167,19 @@ public class ModifyToolBar { ButtonGroup tableGroup = new ButtonGroup(); tableGroup.setId("Table"); tableGroup.setStyleName("ribbon"); - tableGroup.setHeadingText("Table"); + tableGroup.setHeadingText(msgs.tableGroupHeadingText()); tableGroup.enable(); toolBar.add(tableGroup); FlexTable tableLayout = new FlexTable(); tableGroup.add(tableLayout); - groupbyButton = new TextButton("Group By", + groupbyButton = new TextButton(msgs.groupbyButton(), TabularDataResources.INSTANCE.group32()); groupbyButton.disable(); groupbyButton.setScale(ButtonScale.LARGE); groupbyButton.setIconAlign(IconAlign.TOP); - groupbyButton.setToolTip("Perform data grouping"); + groupbyButton.setToolTip(msgs.groupbyButtonToolTip()); groupbyButton.setArrowAlign(ButtonArrowAlign.BOTTOM); groupbyButton.addSelectHandler(new SelectHandler() { @@ -187,13 +190,13 @@ public class ModifyToolBar { tableLayout.setWidget(0, 0, groupbyButton); tableLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); - - timeAggregationButton = new TextButton("Time Aggregation", + + timeAggregationButton = new TextButton(msgs.timeAggregationButton(), TabularDataResources.INSTANCE.timeAggregate32()); timeAggregationButton.disable(); timeAggregationButton.setScale(ButtonScale.LARGE); timeAggregationButton.setIconAlign(IconAlign.TOP); - timeAggregationButton.setToolTip("Performs time aggregation"); + timeAggregationButton.setToolTip(msgs.timeAggregationButtonToolTip()); timeAggregationButton.setArrowAlign(ButtonArrowAlign.BOTTOM); timeAggregationButton.addSelectHandler(new SelectHandler() { @@ -206,12 +209,12 @@ public class ModifyToolBar { tableLayout.setWidget(0, 1, timeAggregationButton); tableLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); - unionButton = new TextButton("Union", + unionButton = new TextButton(msgs.unionButton(), TabularDataResources.INSTANCE.union32()); unionButton.disable(); unionButton.setScale(ButtonScale.LARGE); unionButton.setIconAlign(IconAlign.TOP); - unionButton.setToolTip("Merge tables data"); + unionButton.setToolTip(msgs.unionButtonToolTip()); unionButton.setArrowAlign(ButtonArrowAlign.BOTTOM); unionButton.addSelectHandler(new SelectHandler() { @@ -229,7 +232,7 @@ public class ModifyToolBar { ButtonGroup geospatialGroup = new ButtonGroup(); geospatialGroup.setId("Geospatial"); geospatialGroup.setStyleName("ribbon"); - geospatialGroup.setHeadingText("Geospatial"); + geospatialGroup.setHeadingText(msgs.geospatialGroupHeadingText()); geospatialGroup.enable(); geospatialGroup.setVisible(true); toolBar.add(geospatialGroup); @@ -237,12 +240,12 @@ public class ModifyToolBar { FlexTable geospatialLayout = new FlexTable(); geospatialGroup.add(geospatialLayout); - csquareButton = new TextButton("C-Square", + csquareButton = new TextButton(msgs.csquareButton(), TabularDataResources.INSTANCE.geospatialCSquare32()); csquareButton.disable(); csquareButton.setScale(ButtonScale.LARGE); csquareButton.setIconAlign(IconAlign.TOP); - csquareButton.setToolTip("Create C-Square Coordinates"); + csquareButton.setToolTip(msgs.csquareButtonToolTip()); csquareButton.setArrowAlign(ButtonArrowAlign.BOTTOM); csquareButton.addSelectHandler(new SelectHandler() { @@ -255,12 +258,12 @@ public class ModifyToolBar { geospatialLayout.setWidget(0, 0, csquareButton); geospatialLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); - downscaleCSquareButton = new TextButton("Downscale", + downscaleCSquareButton = new TextButton(msgs.downscaleCSquareButton(), TabularDataResources.INSTANCE.downscaleCSquare32()); downscaleCSquareButton.disable(); downscaleCSquareButton.setScale(ButtonScale.LARGE); downscaleCSquareButton.setIconAlign(IconAlign.TOP); - downscaleCSquareButton.setToolTip("Downscale C-Square Coordinates"); + downscaleCSquareButton.setToolTip(msgs.downscaleCSquareButtonToolTip()); downscaleCSquareButton.setArrowAlign(ButtonArrowAlign.BOTTOM); downscaleCSquareButton.addSelectHandler(new SelectHandler() { @@ -273,12 +276,12 @@ public class ModifyToolBar { geospatialLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); - oceanAreaButton = new TextButton("Ocean Area", + oceanAreaButton = new TextButton(msgs.oceanAreaButton(), TabularDataResources.INSTANCE.geospatialOceanArea32()); oceanAreaButton.disable(); oceanAreaButton.setScale(ButtonScale.LARGE); oceanAreaButton.setIconAlign(IconAlign.TOP); - oceanAreaButton.setToolTip("Create Ocean Area Coordinates"); + oceanAreaButton.setToolTip(msgs.oceanAreaButtonToolTip()); oceanAreaButton.setArrowAlign(ButtonArrowAlign.BOTTOM); oceanAreaButton.addSelectHandler(new SelectHandler() { @@ -297,7 +300,7 @@ public class ModifyToolBar { ButtonGroup geometryGroup = new ButtonGroup(); geometryGroup.setId("Geometry"); geometryGroup.setStyleName("ribbon"); - geometryGroup.setHeadingText("Geometry"); + geometryGroup.setHeadingText(msgs.geometryGroupHeadingText()); geometryGroup.enable(); geometryGroup.setVisible(true); toolBar.add(geometryGroup); @@ -305,12 +308,12 @@ public class ModifyToolBar { FlexTable geometryLayout = new FlexTable(); geometryGroup.add(geometryLayout); - pointButton = new TextButton("Points", + pointButton = new TextButton(msgs.pointButton(), TabularDataResources.INSTANCE.geometryPoint32()); pointButton.disable(); pointButton.setScale(ButtonScale.LARGE); pointButton.setIconAlign(IconAlign.TOP); - pointButton.setToolTip("Create Points"); + pointButton.setToolTip(msgs.pointButtonToolTip()); pointButton.setArrowAlign(ButtonArrowAlign.BOTTOM); pointButton.addSelectHandler(new SelectHandler() { @@ -337,11 +340,11 @@ public class ModifyToolBar { private Menu createReplaceMenu() { Menu menuReplace = new Menu(); - replaceBatchItem = new MenuItem("Batch", + replaceBatchItem = new MenuItem(msgs.replaceBatchItem(), TabularDataResources.INSTANCE.columnReplaceBatch()); - replaceByExpressionItem = new MenuItem("By Expression", + replaceByExpressionItem = new MenuItem(msgs.replaceByExpressionItem(), TabularDataResources.INSTANCE.columnReplaceByExpression()); - replaceByExternalColItem = new MenuItem("By External", + replaceByExternalColItem = new MenuItem(msgs.replaceByExternalColItem(), TabularDataResources.INSTANCE.replaceByExternalCol()); replaceBatchItem @@ -385,11 +388,11 @@ public class ModifyToolBar { private Menu createDeleteMenu() { Menu menuDelete = new Menu(); - deleteSelectedRowsItem = new MenuItem("Selected", + deleteSelectedRowsItem = new MenuItem(msgs.deleteSelectedRowsItem(), TabularDataResources.INSTANCE.tableRowDeleteSelected()); - deleteDuplicateItem = new MenuItem("Duplicate", + deleteDuplicateItem = new MenuItem(msgs.deleteDuplicateItem(), TabularDataResources.INSTANCE.tableDuplicateRowsRemove()); - deleteByExpression = new MenuItem("By Expression", + deleteByExpressionItem = new MenuItem(msgs.deleteByExpressionItem(), TabularDataResources.INSTANCE.tableRowDeleteByExpression()); deleteSelectedRowsItem @@ -412,7 +415,7 @@ public class ModifyToolBar { } }); - deleteByExpression + deleteByExpressionItem .addSelectionHandler(new SelectionHandler() { @Override @@ -424,7 +427,7 @@ public class ModifyToolBar { menuDelete.add(deleteSelectedRowsItem); menuDelete.add(deleteDuplicateItem); - menuDelete.add(deleteByExpression); + menuDelete.add(deleteByExpressionItem); return menuDelete; } diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.java new file mode 100644 index 0000000..c75c2ea --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.java @@ -0,0 +1,111 @@ +package org.gcube.portlets.user.td.client.ribbon; + +import com.google.gwt.i18n.client.Messages; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public interface ModifyToolBarMessages extends Messages { + + @DefaultMessage("Rows") + String rowsGroupHeadingText(); + + @DefaultMessage("Replace") + String replaceButton(); + + @DefaultMessage("Replace rows") + String replaceButtonToolTip(); + + @DefaultMessage("Delete") + String deleteButton(); + + @DefaultMessage("Delete rows") + String deleteButtonToolTip(); + + @DefaultMessage("Add") + String addRowButton(); + + @DefaultMessage("Add row") + String addRowButtonToolTip(); + + @DefaultMessage("Filter") + String filterButton(); + + @DefaultMessage("Filter rows") + String filterButtonToolTip(); + + @DefaultMessage("Table") + String tableGroupHeadingText(); + + @DefaultMessage("Group By") + String groupbyButton(); + + @DefaultMessage("Perform data grouping") + String groupbyButtonToolTip(); + + @DefaultMessage("Time Aggregation") + String timeAggregationButton(); + + @DefaultMessage("Performs time aggregation") + String timeAggregationButtonToolTip(); + + @DefaultMessage("Union") + String unionButton(); + + @DefaultMessage("Merge tables data") + String unionButtonToolTip(); + + @DefaultMessage("Geospatial") + String geospatialGroupHeadingText(); + + @DefaultMessage("C-Square") + String csquareButton(); + + @DefaultMessage("Create C-Square Coordinates") + String csquareButtonToolTip(); + + @DefaultMessage("Downscale") + String downscaleCSquareButton(); + + @DefaultMessage("Downscale C-Square Coordinates") + String downscaleCSquareButtonToolTip(); + + @DefaultMessage("Ocean Area") + String oceanAreaButton(); + + @DefaultMessage("Create Ocean Area Coordinates") + String oceanAreaButtonToolTip(); + + @DefaultMessage("Geometry") + String geometryGroupHeadingText(); + + @DefaultMessage("Points") + String pointButton(); + + @DefaultMessage("Create Points") + String pointButtonToolTip(); + + // Menu Replace + @DefaultMessage("Batch") + String replaceBatchItem(); + + @DefaultMessage("By Expression") + String replaceByExpressionItem(); + + @DefaultMessage("By External") + String replaceByExternalColItem(); + + // Menu Delete + @DefaultMessage("Selected") + String deleteSelectedRowsItem(); + + @DefaultMessage("Duplicate") + String deleteDuplicateItem(); + + @DefaultMessage("By Expression") + String deleteByExpressionItem(); + +} \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.properties b/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.properties new file mode 100644 index 0000000..ea44e5b --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages.properties @@ -0,0 +1,32 @@ +rowsGroupHeadingText = Rows +replaceButton = Replace +replaceButtonToolTip = "Replace rows" +deleteButton = Delete +deleteButtonToolTip = Delete rows +addButton = Add +addButtonToolTip = Add row +filterButton = Filter +filterButtonToolTip = Filter Rows +tableGroupHeadingText = Table +groupbyButton = Group By +groupbyButtonToolTip = Perform data grouping +timeAggregationButton = Time Aggregation +timeAggregationButtonToolTip = Performs time aggregation +unionButton = Union +unionButtonToolTip = Merge tables data +geospatialGroupHeadingText = Geospatial +csquareButton = C-Square +csquareButtonToolTip = Create C-Square Coordinates +downscaleCSquareButton = Downscale +downscaleCSquareButtonToolTip = Downscale C-Square Coordinates +oceanAreaButton = Ocean Area +oceanAreaButtonToolTip = Create Ocean Area Coordinates +geometryGroupHeadingText = Geometry +pointButton = Points +pointButtonToolTip = Create Points +replaceBatchItem = Batch +replaceByExpressionItem = By Expression +replaceByExternalColItem = By External +deleteSelectedRowsItem = Selected +deleteDuplicateItem = Duplicate +deleteByExpressionItem = By Expression \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_es.properties new file mode 100644 index 0000000..182d5d7 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_es.properties @@ -0,0 +1,32 @@ +rowsGroupHeadingText = Líneas +replaceButton = Reemplazar +replaceButtonToolTip = Reemplace las líneas +deleteButton = Eliminar +deleteButtonToolTip = Eliminar filas +addButton = Añadir +addButtonToolTip = Añadir fila +filterButton = Filtrar +filterButtonToolTip = Filtrar líneas +tableGroupHeadingText = Mesa +groupbyButton = Group By +groupbyButtonToolTip = Realiza grupo en datos +timeAggregationButton = Agregación Temporal +timeAggregationButtonToolTip = Realiza agregación temporal +unionButton = Unión +unionButtonToolTip = Combinar Tablas +geospatialGroupHeadingText = Geoespacial +csquareButton = C-Square +csquareButtonToolTip = Crear coordenadas de tipo C-Square +downscaleCSquareButton = Downscale +downscaleCSquareButtonToolTip = Hacer una escalada de coordenadas C-Square +oceanAreaButton = Ocean Area +oceanAreaButtonToolTip = Crear coordenadas tipo Ocean Area +geometryGroupHeadingText = Geometrías +pointButton = Puntos +pointButtonToolTip = Crear Puntos +replaceBatchItem = Batch +replaceByExpressionItem = Usar Expresiones +replaceByExternalColItem = Usar TR Externa +deleteSelectedRowsItem = Seleccionado +deleteDuplicateItem = Duplicados +deleteByExpressionItem = Usar Expresiones \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_it.properties new file mode 100644 index 0000000..75ef45c --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/client/ribbon/ModifyToolBarMessages_it.properties @@ -0,0 +1,32 @@ +rowsGroupHeadingText = Righe +replaceButton = Rimpiazza +replaceButtonToolTip = Rimpiazza righe +deleteButton = Elimina +deleteButtonToolTip = Elimina righe +addButton = Aggiungi +addButtonToolTip = Aggiungi riga +filterButton = Filtra +filterButtonToolTip = Filtra righe +tableGroupHeadingText = Tabella +groupbyButton = Group By +groupbyButtonToolTip = Esegue la group by sui dati +timeAggregationButton = Aggregazione Temporale +timeAggregationButtonToolTip = Esegue aggregazione temporale +unionButton = Unione +unionButtonToolTip = Unisce tabelle +geospatialGroupHeadingText = Geospaziale +csquareButton = C-Square +csquareButtonToolTip = Crea coordinate di tipo C-Square +downscaleCSquareButton = Downscale +downscaleCSquareButtonToolTip = Effettua una scalatura su coordinate C-Square +oceanAreaButton = Ocean Area +oceanAreaButtonToolTip = Crea coordinate di tipo Ocean Area +geometryGroupHeadingText = Geometrie +pointButton = Punti +pointButtonToolTip = Crea Punti +replaceBatchItem = Batch +replaceByExpressionItem = Usando Espressioni +replaceByExternalColItem = Usando TR Esterne +deleteSelectedRowsItem = Selezionati +deleteDuplicateItem = Duplicati +deleteByExpressionItem = Usando Espressioni \ No newline at end of file