Added i18N support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-wizard-widget@119350 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-02 15:37:17 +00:00 committed by Giancarlo Panichi
parent 1a455b92e5
commit f95d952261
8 changed files with 75 additions and 33 deletions

View File

@ -0,0 +1,24 @@
package org.gcube.portlets.user.td.wizardwidget.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 WizardMessages extends Messages {
//
@DefaultMessage("Back")
String buttonBackLabel();
@DefaultMessage("Next")
String buttonNextLabel();
@DefaultMessage("Finish")
String buttonFinishLabel();
}

View File

@ -11,9 +11,10 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.user.client.Command;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Widget;
import com.google.web.bindery.event.shared.EventBus;
@ -45,9 +46,6 @@ public class WizardWindow extends Window {
protected String WIZARDHEIGHT = "520px";
protected boolean WIZARRESIZABLE = false;
protected boolean WIZARDCOLLAPSIBLE = true;
protected String BUTTONBACKLABEL = "Back";
protected String BUTTONNEXTLABEL = "Next";
protected String BUTTONFINISHLABEL = "Finish";
protected String title;
protected ArrayList<WizardCard> cardStack = new ArrayList<WizardCard>();
@ -75,6 +73,7 @@ public class WizardWindow extends Window {
protected ToolBar cardMoveToolBar;
protected FillToolItem fillSpacingCardMoveToolBar;
protected WizardMessages msgs;
/**
* Create a new Wizard Window with the specified title.
@ -91,6 +90,8 @@ public class WizardWindow extends Window {
super();
this.title = title;
this.eventBus = eventBus;
this.msgs = GWT.create(WizardMessages.class);
initWindow();
listeners = new ArrayList<WizardListener>();
@ -103,7 +104,7 @@ public class WizardWindow extends Window {
cardMoveToolBar.setSpacing(2);
cardMoveToolBar.addStyleName(ThemeStyles.get().style().borderTop());
backButton = new TextButton(BUTTONBACKLABEL);
backButton = new TextButton(msgs.buttonBackLabel());
backButton.setIcon(ResourceBundle.INSTANCE.wizardPrevious());
backButton.setIconAlign(IconAlign.LEFT);
@ -115,7 +116,7 @@ public class WizardWindow extends Window {
cardMoveToolBar.add(fillSpacingCardMoveToolBar);
nextButton = new TextButton(BUTTONNEXTLABEL);
nextButton = new TextButton(msgs.buttonNextLabel());
nextButton.setIcon(ResourceBundle.INSTANCE.wizardNext());
nextButton.setIconAlign(IconAlign.RIGHT);
nextButton.setTabIndex(1000);
@ -303,7 +304,7 @@ public class WizardWindow extends Window {
* to it.
*/
public void setNextButtonToFinish() {
nextButton.setText(BUTTONFINISHLABEL);
nextButton.setText(msgs.buttonNextLabel());
nextButton.setIcon(ResourceBundle.INSTANCE.wizardGo());
nextButton.setIconAlign(IconAlign.RIGHT);
nextButtonAction = new Command() {

View File

@ -1,30 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Wizard'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- <inherits name="com.google.gwt.i18n.I18N" /> -->
<!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' />
<!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<inherits name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
<!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.td.wizardwidget.client.WizardEntry' /> -->
<!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<inherits
name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
<!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.td.wizardwidget.client.WizardEntry'
/> -->
<!-- <set-configuration-property name="locale.cookie" value="TDLangCookie"
/> <set-configuration-property name="locale.queryparam" value="TDLang" />
<set-configuration-property name="locale.usemeta" value="Y" /> <set-configuration-property
name="locale.useragent" value="Y" /> <set-configuration-property name="locale.searchorder"
value="cookie,queryparam,meta,useragent" /> <extend-property name="locale"
values="en" /> <extend-property name="locale" values="it" /> <extend-property
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>

View File

@ -1,2 +0,0 @@
sendButton = Send
nameField = Enter your name

View File

@ -1,2 +0,0 @@
sendButton = Envoyer
nameField = Entrez votre nom

View File

@ -0,0 +1,3 @@
buttonBackLabel = Back
buttonNextLabel = Next
buttonFinishLabel = Finish

View File

@ -0,0 +1,3 @@
buttonBackLabel = Volver
buttonNextLabel = Adelante
buttonFinishLabel = Final

View File

@ -0,0 +1,3 @@
buttonBackLabel = Indietro
buttonNextLabel = Avanti
buttonFinishLabel = Fine