<!-- all main resources without filtering -->
<directory>src/main/resources</directory>
</resource>
- <resource>
- <!-- i10n resources -->
- <directory>src/main/java/eu/etaxonomy/cdm/i10n</directory>
- <targetPath>../classes/eu/etaxonomy/cdm/i10n</targetPath>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
</resources>
<plugins>
<plugin>
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2017 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.cdm.i10n;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @author freimeier
- * @date 27.11.2017
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "eu.etaxonomy.cdm.i10n.messages"; //$NON-NLS-1$
- public static String AreaAndTaxonSettingsConfigWindow_AREAS;
- public static String AreaAndTaxonSettingsConfigWindow_CLASSIFICATION;
- public static String AreaAndTaxonSettingsConfigWindow_DISTRIBUTION_AREA;
- public static String AreaAndTaxonSettingsConfigWindow_FILTER;
- public static String AreaAndTaxonSettingsConfigWindow_FILTER_TAXA_BY_NAME;
- public static String AreaAndTaxonSettingsConfigWindow_LOADING_COMPLETE;
- public static String AreaAndTaxonSettingsConfigWindow_LOADING_TAXA;
- public static String AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION;
- public static String AreaAndTaxonSettingsConfigWindow_SELECT_DISTRIBUTION_AREA;
- public static String AreaAndTaxonSettingsConfigWindow_TAXONOMY;
- public static String DetailWindow_NO_DESCRIPTIVE_DATA_FOUND;
- public static String DistributionStatusSettingsConfigWindow_DISTRIBUTION_STATUS;
- public static String DistributionStatusSettingsConfigWindow_SHOW_ABBREVIATED_LABELS;
- public static String DistributionTablePresenter_ERROR_UPDATE_DISTRIBUTION_TERM;
- public static String DistributionTableViewBean_AREAS_AND_TAXA;
- public static String DistributionTableViewBean_SELECT_TAXON;
- public static String DistributionTableViewBean_STATUS;
- public static String DistributionTableViewBean_TAXON;
- public static String DistributionTableViewBean_TAXON_DETAILS;
- public static String DistributionTableViewBean_TOTAL_TAXA;
- public static String DistributionToolbar_AREAS_AND_TAXA;
- public static String DistributionToolbar_DETAIL;
- public static String DistributionToolbar_EDIT;
- public static String DistributionToolbar_LOGIN;
- public static String DistributionToolbar_LOGOUT;
- public static String DistributionToolbar_SAVE;
- public static String DistributionToolbar_STATUS;
- public static String SettingsDialogWindowBase_CANCEL;
- public static String SettingsDialogWindowBase_OK;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.i18n;
+
+import java.io.Serializable;
+import java.util.ResourceBundle;
+
+import com.vaadin.server.VaadinSession;
+
+/**
+ * @author freimeier
+ * @date 07.12.2017
+ *
+ */
+public class Messages implements Serializable {
+ public static final String BUNDLE_NAME = "eu.etaxonomy.cdm.i18n.messages";
+ public static String AreaAndTaxonSettingsConfigWindow_AREAS = "AreaAndTaxonSettingsConfigWindow_AREAS";
+ public static String AreaAndTaxonSettingsConfigWindow_CLASSIFICATION = "AreaAndTaxonSettingsConfigWindow_CLASSIFICATION";
+ public static String AreaAndTaxonSettingsConfigWindow_DISTRIBUTION_AREA = "AreaAndTaxonSettingsConfigWindow_DISTRIBUTION_AREA";
+ public static String AreaAndTaxonSettingsConfigWindow_FILTER = "AreaAndTaxonSettingsConfigWindow_FILTER";
+ public static String AreaAndTaxonSettingsConfigWindow_FILTER_TAXA_BY_NAME = "AreaAndTaxonSettingsConfigWindow_FILTER_TAXA_BY_NAME";
+ public static String AreaAndTaxonSettingsConfigWindow_LOADING_COMPLETE = "AreaAndTaxonSettingsConfigWindow_LOADING_COMPLETE";
+ public static String AreaAndTaxonSettingsConfigWindow_LOADING_TAXA = "AreaAndTaxonSettingsConfigWindow_LOADING_TAXA";
+ public static String AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION = "AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION";
+ public static String AreaAndTaxonSettingsConfigWindow_SELECT_DISTRIBUTION_AREA = "AreaAndTaxonSettingsConfigWindow_SELECT_DISTRIBUTION_AREA";
+ public static String AreaAndTaxonSettingsConfigWindow_TAXONOMY = "AreaAndTaxonSettingsConfigWindow_TAXONOMY";
+ public static String DetailWindow_NO_DESCRIPTIVE_DATA_FOUND = "DetailWindow_NO_DESCRIPTIVE_DATA_FOUND";
+ public static String DistributionStatusSettingsConfigWindow_DISTRIBUTION_STATUS = "DistributionStatusSettingsConfigWindow_DISTRIBUTION_STATUS";
+ public static String DistributionStatusSettingsConfigWindow_SHOW_ABBREVIATED_LABELS = "DistributionStatusSettingsConfigWindow_SHOW_ABBREVIATED_LABELS";
+ public static String DistributionTablePresenter_ERROR_UPDATE_DISTRIBUTION_TERM = "DistributionTablePresenter_ERROR_UPDATE_DISTRIBUTION_TERM";
+ public static String DistributionTableViewBean_AREAS_AND_TAXA = "DistributionTableViewBean_AREAS_AND_TAXA";
+ public static String DistributionTableViewBean_SELECT_TAXON = "DistributionTableViewBean_SELECT_TAXON";
+ public static String DistributionTableViewBean_STATUS = "DistributionTableViewBean_STATUS";
+ public static String DistributionTableViewBean_TAXON = "DistributionTableViewBean_TAXON";
+ public static String DistributionTableViewBean_TAXON_DETAILS = "DistributionTableViewBean_TAXON_DETAILS";
+ public static String DistributionTableViewBean_TOTAL_TAXA = "DistributionTableViewBean_TOTAL_TAXA";
+ public static String DistributionToolbar_AREAS_AND_TAXA = "DistributionToolbar_AREAS_AND_TAXA";
+ public static String DistributionToolbar_DETAIL = "DistributionToolbar_DETAIL";
+ public static String DistributionToolbar_EDIT = "DistributionToolbar_EDIT";
+ public static String DistributionToolbar_LOGIN = "DistributionToolbar_LOGIN";
+ public static String DistributionToolbar_LOGOUT = "DistributionToolbar_LOGOUT";
+ public static String DistributionToolbar_SAVE = "DistributionToolbar_SAVE";
+ public static String DistributionToolbar_STATUS = "DistributionToolbar_STATUS";
+ public static String SettingsDialogWindowBase_CANCEL = "SettingsDialogWindowBase_CANCEL";
+ public static String SettingsDialogWindowBase_OK = "SettingsDialogWindowBase_OK";
+
+ public static String getLocalizedString(String key) {
+ return ResourceBundle.getBundle(BUNDLE_NAME, VaadinSession.getCurrent().getLocale()).getString(key);
+ }
+}
import com.vaadin.ui.Tree;
import com.vaadin.ui.Window;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.description.CategoricalData;
window.setCaption(taxon.getName().getTitleCache());
window.setCloseShortcut(KeyCode.W, ModifierKey.CTRL);
if(listDescriptions.isEmpty()){
- window.setContent(new Label(Messages.DetailWindow_NO_DESCRIPTIVE_DATA_FOUND));
+ window.setContent(new Label(Messages.getLocalizedString(Messages.DetailWindow_NO_DESCRIPTIVE_DATA_FOUND)));
}
else{
window.setContent(constructDescriptionTree(taxon));
import com.vaadin.ui.HorizontalLayout;
import eu.etaxonomy.cdm.api.application.CdmRepository;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.service.CdmUserHelper;
import eu.etaxonomy.cdm.vaadin.event.AuthenticationSuccessEvent;
import eu.etaxonomy.vaadin.ui.navigation.NavigationEvent;
@Autowired
private CdmUserHelper userHelper;
- private final Button loginButton = new Button(Messages.DistributionToolbar_LOGIN);
+ private final Button loginButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_LOGIN));
- private final Button logoutButton = new Button(Messages.DistributionToolbar_LOGOUT);
+ private final Button logoutButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_LOGOUT));
private final Button userButton = new Button(FontAwesome.USER);
- private final Button editButton = new Button(Messages.DistributionToolbar_EDIT);
+ private final Button editButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_EDIT));
- private final Button saveButton = new Button(Messages.DistributionToolbar_SAVE);
+ private final Button saveButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_SAVE));
- private final Button detailButton = new Button(Messages.DistributionToolbar_DETAIL);
+ private final Button detailButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_DETAIL));
- private final Button distributionSettingsButton = new Button(Messages.DistributionToolbar_AREAS_AND_TAXA);
+ private final Button distributionSettingsButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_AREAS_AND_TAXA));
- private final Button settingsButton = new Button(Messages.DistributionToolbar_STATUS);
+ private final Button settingsButton = new Button(Messages.getLocalizedString(Messages.DistributionToolbar_STATUS));
// private final Authentication authentication;
// private ExcelExporter exporter = new ExcelExporter();
import com.vaadin.ui.VerticalLayout;
import eu.etaxonomy.cdm.common.CdmUtils;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.taxon.Classification;
rightContainer.setSizeFull();
//classification
- classificationBox = new ComboBox(Messages.AreaAndTaxonSettingsConfigWindow_CLASSIFICATION);
+ classificationBox = new ComboBox(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_CLASSIFICATION));
classificationBox.setItemCaptionPropertyId(TaxonNodeContainer.LABEL);
- classificationBox.setInputPrompt(Messages.AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION);
+ classificationBox.setInputPrompt(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION));
classificationBox.setImmediate(true);
classificationBox.setNewItemsAllowed(false);
classificationBox.setNullSelectionAllowed(false);
classificationBox.setWidth("100%"); //$NON-NLS-1$
//taxonFilter
- taxonFilter = new TextField(Messages.AreaAndTaxonSettingsConfigWindow_FILTER);
- taxonFilter.setInputPrompt(Messages.AreaAndTaxonSettingsConfigWindow_FILTER_TAXA_BY_NAME);
+ taxonFilter = new TextField(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_FILTER));
+ taxonFilter.setInputPrompt(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_FILTER_TAXA_BY_NAME));
taxonFilter.setSizeFull();
taxonFilter.setImmediate(true);
//distribution area box
- distAreaBox = new ComboBox(Messages.AreaAndTaxonSettingsConfigWindow_DISTRIBUTION_AREA);
- distAreaBox.setInputPrompt(Messages.AreaAndTaxonSettingsConfigWindow_SELECT_DISTRIBUTION_AREA);
+ distAreaBox = new ComboBox(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_DISTRIBUTION_AREA));
+ distAreaBox.setInputPrompt(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_SELECT_DISTRIBUTION_AREA));
distAreaBox.setImmediate(true);
distAreaBox.setNullSelectionAllowed(false);
distAreaBox.setNewItemsAllowed(false);
// named areas
namedAreaList = new ListSelect();
- namedAreaList.setCaption(Messages.AreaAndTaxonSettingsConfigWindow_AREAS);
+ namedAreaList.setCaption(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_AREAS));
namedAreaList.setSizeFull();
namedAreaList.setMultiSelect(true);
//taxonomy
- taxonTree = new TreeTable(Messages.AreaAndTaxonSettingsConfigWindow_TAXONOMY);
+ taxonTree = new TreeTable(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_TAXONOMY));
taxonTree.setSelectable(true);
taxonTree.setSizeFull();
taxonTree.setImmediate(true);
String filterText = taxonFilter.getValue();
Property<?> uuidProperty = classificationBox.getContainerProperty(classificationBox.getValue(),"uuid"); //$NON-NLS-1$
if(uuidProperty==null){
- Notification.show(Messages.AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION);
+ Notification.show(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_SELECT_CLASSIFICATION));
}
else{
if(CdmUtils.isNotBlank(filterText)){
UI.getCurrent().setPollInterval(500);
taxonTree.setEnabled(false);
taxonTree.removeAllItems();
- Notification.show(Messages.AreaAndTaxonSettingsConfigWindow_LOADING_TAXA);
+ Notification.show(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_LOADING_TAXA));
new TreeUpdater(children).start();
}
public void run() {
taxonTree.setContainerDataSource(new TaxonNodeContainer(children));
- Notification notification = new Notification(Messages.AreaAndTaxonSettingsConfigWindow_LOADING_COMPLETE);
+ Notification notification = new Notification(Messages.getLocalizedString(Messages.AreaAndTaxonSettingsConfigWindow_LOADING_COMPLETE));
notification.setDelayMsec(500);
notification.show(Page.getCurrent());
taxonTree.setEnabled(true);
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.VerticalLayout;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.vaadin.util.DistributionEditorUtil;
import eu.etaxonomy.cdm.vaadin.view.distributionStatus.settings.DistributionStatusSettingsPresenter;
mainLayout.setSpacing(true);
//distribution status
- distStatusSelect = new ListSelect(Messages.DistributionStatusSettingsConfigWindow_DISTRIBUTION_STATUS);
+ distStatusSelect = new ListSelect(Messages.getLocalizedString(Messages.DistributionStatusSettingsConfigWindow_DISTRIBUTION_STATUS));
distStatusSelect.setImmediate(false);
distStatusSelect.setMultiSelect(true);
distStatusSelect.setSizeFull();
distStatusSelect.setWidth("100%"); //$NON-NLS-1$
//toggle abbreviated labels
- boxToggleAbbreviatedLabels = new CheckBox(Messages.DistributionStatusSettingsConfigWindow_SHOW_ABBREVIATED_LABELS, DistributionEditorUtil.isAbbreviatedLabels());
+ boxToggleAbbreviatedLabels = new CheckBox(Messages.getLocalizedString(Messages.DistributionStatusSettingsConfigWindow_SHOW_ABBREVIATED_LABELS), DistributionEditorUtil.isAbbreviatedLabels());
boxToggleAbbreviatedLabels.setImmediate(true);
mainLayout.addComponent(boxToggleAbbreviatedLabels);
import com.vaadin.ui.Notification;
import eu.etaxonomy.cdm.api.application.CdmRepository;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
import eu.etaxonomy.cdm.model.common.Language;
}
}
if(namedArea==null){
- Notification.show(Messages.DistributionTablePresenter_ERROR_UPDATE_DISTRIBUTION_TERM);
+ Notification.show(Messages.getLocalizedString(Messages.DistributionTablePresenter_ERROR_UPDATE_DISTRIBUTION_TERM));
repo.commitTransaction(tx);
return -1;
}
import com.vaadin.ui.Window;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.Representation;
table.setVisibleColumns(columnList.toArray());
table.setColumnHeaders(columnList.toArray(string));
- table.setColumnFooter(CdmQueryFactory.TAXON_COLUMN, "Total amount of Taxa displayed: " + container.size());
+ table.setColumnFooter(CdmQueryFactory.TAXON_COLUMN, String.format(Messages.getLocalizedString(Messages.DistributionTableViewBean_TOTAL_TAXA), gridcontainer.size()));
// gridcontainer = getPresenter().getAreaDistributionStatusContainer();
// if(gridcontainer==null){
private void createEditClickListener(){
//details
Button detailButton = toolbar.getDetailButton();
- detailButton.setCaption(Messages.DistributionTableViewBean_TAXON_DETAILS);
+ detailButton.setCaption(Messages.getLocalizedString(Messages.DistributionTableViewBean_TAXON_DETAILS));
detailButton.addClickListener(event -> {
Object selectedItemId = DistributionTableViewBean.this.table.getValue();
// Object selectedItemId = DistributionTableViewBean.this.grid.getSelectedRow();
getUI().addWindow(window);
}
else{
- Notification.show(Messages.DistributionTableViewBean_SELECT_TAXON, Type.HUMANIZED_MESSAGE);
+ Notification.show(Messages.getLocalizedString(Messages.DistributionTableViewBean_SELECT_TAXON), Type.HUMANIZED_MESSAGE);
}
}
);
if(distributionStatusConfigWindow==null){
distributionStatusConfigWindow = new DistributionStatusSettingsConfigWindow(this);
}
- Window window = distributionStatusConfigWindow.createWindow(Messages.DistributionTableViewBean_STATUS);
+ Window window = distributionStatusConfigWindow.createWindow(Messages.getLocalizedString(Messages.DistributionTableViewBean_STATUS));
window.setWidth("25%"); //$NON-NLS-1$
window.setHeight("60%"); //$NON-NLS-1$
UI.getCurrent().addWindow(window);
if(areaAndTaxonConfigWindow==null){
areaAndTaxonConfigWindow = new AreaAndTaxonSettingsConfigWindow(this);
}
- Window window = areaAndTaxonConfigWindow.createWindow(Messages.DistributionTableViewBean_AREAS_AND_TAXA);
+ Window window = areaAndTaxonConfigWindow.createWindow(Messages.getLocalizedString(Messages.DistributionTableViewBean_AREAS_AND_TAXA));
UI.getCurrent().addWindow(window);
}
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Window;
-import eu.etaxonomy.cdm.i10n.Messages;
+import eu.etaxonomy.cdm.i18n.Messages;
import eu.etaxonomy.cdm.vaadin.view.distributionStatus.settings.SettingsPresenterBase;
@SuppressWarnings("serial")
HorizontalLayout buttonToolBar = new HorizontalLayout();
// cancelButton
cancelButton = new Button();
- cancelButton.setCaption(Messages.SettingsDialogWindowBase_CANCEL);
+ cancelButton.setCaption(Messages.getLocalizedString(Messages.SettingsDialogWindowBase_CANCEL));
cancelButton.setImmediate(true);
cancelButton.addStyleName("dialogButton"); //$NON-NLS-1$
buttonToolBar.addComponent(cancelButton);
// okButton
okButton = new Button();
- okButton.setCaption(Messages.SettingsDialogWindowBase_OK);
+ okButton.setCaption(Messages.getLocalizedString(Messages.SettingsDialogWindowBase_OK));
okButton.setImmediate(true);
okButton.addStyleName("dialogButton"); //$NON-NLS-1$
buttonToolBar.addComponent(okButton);