Updated i18n support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-information-widget@113926 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-04-09 13:33:25 +00:00
parent b3ca438618
commit cad5b4c893
8 changed files with 298 additions and 35 deletions

View File

@ -66,7 +66,7 @@ public class TabularResourceProperties extends FramedPanel {
private static final String DESCRIPTION_FIELD_HEIGHT = "70px";
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
private TabularResourcePropertiesMessages msgs;
private EventBus eventBus;
private TRId trId;
@ -100,10 +100,13 @@ public class TabularResourceProperties extends FramedPanel {
private ArrayList<LicenceData> licencesList;
public TabularResourceProperties(String name, EventBus eventBus) {
super();
setId(name);
this.eventBus = eventBus;
this.msgs = GWT.create(TabularResourcePropertiesMessages.class);
forceLayoutOnResize = true;
retrieveLicencesList();
@ -117,51 +120,72 @@ public class TabularResourceProperties extends FramedPanel {
nameField = new TextField();
nameField.setValue("");
layoutTabularResource.add(new FieldLabel(nameField, "Name"),
FieldLabel nameLabel=new FieldLabel(nameField, msgs.nameLabel());
nameLabel.setToolTip(msgs.nameLabelToolTip());
layoutTabularResource.add(nameLabel,
new VerticalLayoutData(1, -1));
descriptionField = new TextArea();
descriptionField.setHeight(DESCRIPTION_FIELD_HEIGHT);
descriptionField.setValue("");
layoutTabularResource.add(new FieldLabel(descriptionField,
"Description"), new VerticalLayoutData(1, -1));
FieldLabel descriptionLabel=new FieldLabel(descriptionField,
msgs.descriptionLabel());
descriptionLabel.setToolTip(msgs.descriptionLabelToolTip());
layoutTabularResource.add(descriptionLabel, new VerticalLayoutData(1, -1));
typeField = new TextField();
typeField.setReadOnly(true);
typeField.setValue("");
layoutTabularResource.add(new FieldLabel(typeField, "Type"),
FieldLabel typeLabel= new FieldLabel(typeField, msgs.typeLabel());
typeLabel.setToolTip(msgs.typeLabelToolTip());
layoutTabularResource.add(typeLabel,
new VerticalLayoutData(1, -1));
agencyField = new TextField();
agencyField.setValue("");
layoutTabularResource.add(new FieldLabel(agencyField, "Agency"),
FieldLabel agencyLabel=new FieldLabel(agencyField, msgs.agencyLabel());
agencyLabel.setToolTip(msgs.agencyLabelToolTip());
layoutTabularResource.add(agencyLabel,
new VerticalLayoutData(1, -1));
dateField = new TextField();
dateField.setReadOnly(true);
dateField.setValue("");
layoutTabularResource.add(new FieldLabel(dateField, "Creation Date"),
FieldLabel dateLabel= new FieldLabel(dateField, msgs.dateLabel());
dateLabel.setToolTip(msgs.dateLabelToolTip());
layoutTabularResource.add(dateLabel,
new VerticalLayoutData(1, -1));
tableTypeNameField = new TextField();
tableTypeNameField.setReadOnly(true);
tableTypeNameField.setValue("");
layoutTabularResource.add(new FieldLabel(tableTypeNameField, "Table Type"),
FieldLabel tableTypeNameLabel=new FieldLabel(tableTypeNameField, msgs.tableTypeNameLabel());
tableTypeNameLabel.setToolTip(msgs.tableTypeNameLabelToolTip());
layoutTabularResource.add(tableTypeNameLabel,
new VerticalLayoutData(1, -1));
rightField = new TextArea();
rightField.setValue("");
layoutTabularResource.add(new FieldLabel(rightField, "Rights"),
FieldLabel rightLabel=new FieldLabel(rightField, msgs.rightLabel());
rightLabel.setToolTip(msgs.rightLabelToolTip());
layoutTabularResource.add(rightLabel,
new VerticalLayoutData(1, -1));
validFromField = new DateField();
layoutTabularResource.add(new FieldLabel(validFromField, "Valid From"),
FieldLabel validFromLabel=new FieldLabel(validFromField, msgs.validFromLabel());
validFromLabel.setToolTip(msgs.validFromLabelToolTip());
layoutTabularResource.add(validFromLabel,
new VerticalLayoutData(1, -1));
validUntilToField = new DateField();
layoutTabularResource.add(new FieldLabel(validUntilToField,
"Valid Until To"), new VerticalLayoutData(1, -1));
FieldLabel validUntilToLabel= new FieldLabel(validUntilToField,
msgs.validUntilToLabel());
validUntilToLabel.setToolTip(msgs.validUntilToLabelToolTip());
layoutTabularResource.add(validUntilToLabel, new VerticalLayoutData(1, -1));
// Combo Licences
LicenceDataPropertiesCombo propsLicenceData = GWT
@ -177,14 +201,18 @@ public class TabularResourceProperties extends FramedPanel {
comboLicences.setTriggerAction(TriggerAction.ALL);
Log.trace("Combo Licence created");
layoutTabularResource.add(new FieldLabel(comboLicences, "Licence"),
FieldLabel licencesLabel=new FieldLabel(comboLicences, msgs.licencesLabel());
licencesLabel.setToolTip(msgs.licencesLabelToolTip());
layoutTabularResource.add(licencesLabel,
new VerticalLayoutData(1, -1));
// /
ownerField = new TextField();
ownerField.setReadOnly(true);
ownerField.setValue("");
layoutTabularResource.add(new FieldLabel(ownerField, "Owner"),
FieldLabel ownerLabel=new FieldLabel(ownerField, msgs.ownerLabel());
ownerLabel.setToolTip(msgs.ownerLabelToolTip());
layoutTabularResource.add(ownerLabel,
new VerticalLayoutData(1, -1));
btnShare = new IconButton();
@ -197,7 +225,8 @@ public class TabularResourceProperties extends FramedPanel {
}
});
shareLabel = new FieldLabel(btnShare, "Share");
shareLabel = new FieldLabel(btnShare, msgs.shareLabel());
shareLabel.setToolTip(msgs.shareLabelToolTip());
shareLabel.setVisible(false);
layoutTabularResource.add(shareLabel, new VerticalLayoutData(1, -1));
@ -206,7 +235,9 @@ public class TabularResourceProperties extends FramedPanel {
validField.setValue(false);
validField.setReadOnly(true);
validField.setEnabled(false);
layoutTabularResource.add(new FieldLabel(validField, "Valid"),
FieldLabel validLabel=new FieldLabel(validField, msgs.validLabel());
validLabel.setToolTip(msgs.validLabelToolTip());
layoutTabularResource.add(validLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
finalizedField = new CheckBox();
@ -222,14 +253,17 @@ public class TabularResourceProperties extends FramedPanel {
}
}
});
layoutTabularResource.add(new FieldLabel(finalizedField, "Final"),
FieldLabel finalizedLabel=new FieldLabel(finalizedField, msgs.finalizedLabel());
finalizedLabel.setToolTip(msgs.finalizedLabelToolTip());
layoutTabularResource.add(finalizedLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
// Save Button
saveButton = new TextButton("Save");
saveButton = new TextButton(msgs.saveButton());
saveButton.setIcon(ResourceBundle.INSTANCE.save());
saveButton.setIconAlign(IconAlign.RIGHT);
saveButton.setTitle("Save");
saveButton.setToolTip(msgs.saveButtonToolTip());
SelectHandler saveHandler = new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -240,10 +274,10 @@ public class TabularResourceProperties extends FramedPanel {
saveButton.addSelectHandler(saveHandler);
// Validation Button
validationsButton = new TextButton("Validations");
validationsButton = new TextButton(msgs.validationsButton());
validationsButton.setIcon(ResourceBundle.INSTANCE.tableValidation());
validationsButton.setIconAlign(IconAlign.RIGHT);
validationsButton.setTitle("Validations");
validationsButton.setToolTip(msgs.validationsButtonToolTip());
SelectHandler validationsHandler = new SelectHandler() {
@ -255,10 +289,10 @@ public class TabularResourceProperties extends FramedPanel {
validationsButton.addSelectHandler(validationsHandler);
// Resources Button
resourcesButton = new TextButton("Resources");
resourcesButton = new TextButton(msgs.resourcesButton());
resourcesButton.setIcon(ResourceBundle.INSTANCE.resources());
resourcesButton.setIconAlign(IconAlign.RIGHT);
resourcesButton.setTitle("Resources");
resourcesButton.setToolTip(msgs.resourcesButtonToolTip());
SelectHandler resourcesHandler = new SelectHandler() {

View File

@ -0,0 +1,117 @@
package org.gcube.portlets.user.td.informationwidget.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 TabularResourcePropertiesMessages extends Messages {
//
@DefaultMessage("Name")
String nameLabel();
@DefaultMessage("Name of tabular resource")
String nameLabelToolTip();
@DefaultMessage("Description")
String descriptionLabel();
@DefaultMessage("Description of tabular resource")
String descriptionLabelToolTip();
@DefaultMessage("Type")
String typeLabel();
@DefaultMessage("Type of tabular resource")
String typeLabelToolTip();
@DefaultMessage("Agency")
String agencyLabel();
@DefaultMessage("Agency")
String agencyLabelToolTip();
@DefaultMessage("Creation Date")
String dateLabel();
@DefaultMessage("Creation Date")
String dateLabelToolTip();
@DefaultMessage("Table Type")
String tableTypeNameLabel();
@DefaultMessage("Table Type")
String tableTypeNameLabelToolTip();
@DefaultMessage("Rights")
String rightLabel();
@DefaultMessage("Rights")
String rightLabelToolTip();
@DefaultMessage("Valid From")
String validFromLabel();
@DefaultMessage("Valid From")
String validFromLabelToolTip();
@DefaultMessage("Valid Until To")
String validUntilToLabel();
@DefaultMessage("Valid Until To")
String validUntilToLabelToolTip();
@DefaultMessage("Licence")
String licencesLabel();
@DefaultMessage("Licence")
String licencesLabelToolTip();
@DefaultMessage("Owner")
String ownerLabel();
@DefaultMessage("Owner")
String ownerLabelToolTip();
@DefaultMessage("Share")
String shareLabel();
@DefaultMessage("Share")
String shareLabelToolTip();
@DefaultMessage("Valid")
String validLabel();
@DefaultMessage("Valid")
String validLabelToolTip();
@DefaultMessage("Final")
String finalizedLabel();
@DefaultMessage("Final")
String finalizedLabelToolTip();
@DefaultMessage("Save")
String saveButton();
@DefaultMessage("Save")
String saveButtonToolTip();
@DefaultMessage("Validations")
String validationsButton();
@DefaultMessage("Validations")
String validationsButtonToolTip();
@DefaultMessage("Resources")
String resourcesButton();
@DefaultMessage("Resources")
String resourcesButtonToolTip();
}

View File

@ -2,18 +2,13 @@
<module rename-to='Information'>
<!-- 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' />
<!-- 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" />
@ -22,6 +17,25 @@
<!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.td.information.client.InformationEntry' /> -->
<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' />

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,34 @@
nameLabel = Name
nameLabelToolTip = Name of tabular resource
descriptionLabel = Description
descriptionLabelToolTip = Description of tabular resource
typeLabel = Type
typeLabelToolTip = Type of tabular resource
agencyLabel = Agency
agencyLabelToolTip = Agency
dateLabel = Creation Date
dateLabelToolTip = Creation Date
tableTypeNameLabel = Table Type
tableTypeNameLabelToolTip = Table Type
rightLabel = Rights
rightLabelToolTip = Rights
validFromLabel = Valid From
validFromLabelToolTip = Valid From
validUntilToLabel = Valid Until To
validUntilToLabelToolTip = Valid Until To
licencesLabel = Licence
licencesLabelToolTip = Licence
ownerLabel = Owner
ownerLabelToolTip = Owner
shareLabel = Share
shareLabelToolTip = Share
validLabel = Valid
validLabelToolTip = Valid
finalizedLabel = Final
finalizedLabelToolTip = Final
saveButton = Save
saveButtonToolTip = Save
validationsButton = Validations
validationsButtonToolTip = Validations
resourcesButton = Resources
resourcesButtonToolTip = Resources

View File

@ -0,0 +1,34 @@
nameLabel = Nombre
nameLabelToolTip = Nombre de la tabular resource
descriptionLabel = Descripción
descriptionLabelToolTip = Descripción de la tabular resource
typeLabel = Tipo
typeLabelToolTip = Tipo de tabular resource
agencyLabel = Agencia
agencyLabelToolTip = Agencia
dateLabel = Fecha Creacion
dateLabelToolTip = Fecha Creacion
tableTypeNameLabel = Tipo Tabla
tableTypeNameLabelToolTip = Tipo Tabla
rightLabel = Derechos
rightLabelToolTip = Derechos
validFromLabel = Válida Desde
validFromLabelToolTip = Válida Desde
validUntilToLabel = Válido Hasta
validUntilToLabelToolTip = Válido Hasta
licencesLabel = Licencia
licencesLabelToolTip = Licencia
ownerLabel = Propietario
ownerLabelToolTip = Propietario
shareLabel = Cuota
shareLabelToolTip = Cuota
validLabel = Válido
validLabelToolTip = Válido
finalizedLabel = Final
finalizedLabelToolTip = Final
saveButton = Guardar
saveButtonToolTip = Guardar
validationsButton = Validaciones
validationsButtonToolTip = Validaciones
resourcesButton = Recursos
resourcesButtonToolTip = Recursos

View File

@ -0,0 +1,34 @@
nameLabel = Nome
nameLabelToolTip = Nome della tabular resource
descriptionLabel = Descrizione
descriptionLabelToolTip = Descrizione della tabular resource
typeLabel = Tipo
typeLabelToolTip = Tipo di tabular resource
agencyLabel = Agenzia
agencyLabelToolTip = Agenzia
dateLabel = Data Creazione
dateLabelToolTip = Data Creazione
tableTypeNameLabel = Tipo Tabella
tableTypeNameLabelToolTip = Tipo Tabella
rightLabel = Diritti
rightLabelToolTip = Diritti
validFromLabel = Valida Da
validFromLabelToolTip = Valida Da
validUntilToLabel = Valida Fino Al
validUntilToLabelToolTip = Valida Fino Al
licencesLabel = Licenza
licencesLabelToolTip = Licenza
ownerLabel = Proprietario
ownerLabelToolTip = Proprietario
shareLabel = Condivisione
shareLabelToolTip = Condivisione
validLabel = Valida
validLabelToolTip = Valida
finalizedLabel = Finale
finalizedLabelToolTip = Finale
saveButton = Salva
saveButtonToolTip = Salva
validationsButton = Validazioni
validationsButtonToolTip = Validazioni
resourcesButton = Risorse
resourcesButtonToolTip = Risorse