Strings in ExportSingleReadAlignmentWizardPage externalized and translated.
authorb.stoever <stoever@bioinfweb.info>
Thu, 17 Nov 2016 16:22:59 +0000 (17:22 +0100)
committerb.stoever <stoever@bioinfweb.info>
Thu, 17 Nov 2016 16:22:59 +0000 (17:22 +0100)
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/Messages.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java

diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages.properties
new file mode 100644 (file)
index 0000000..1655259
--- /dev/null
@@ -0,0 +1,16 @@
+wizardExportAlignmentAppendExtensionButton=Append default extension
+wizardExportAlignmentBrowseButton=Browse...
+wizardExportAlignmentDataLabel=Select the data to export:
+wizardExportAlignmentDescription=Defines which data of the single read alignment shall be exported.
+wizardExportAlignmentDestinationLabel=Select the export destination:
+wizardExportAlignmentErrorMissingFileName=The file name must not be empty.
+wizardExportAlignmentErrorMissingSeqLabel=The consensus sequence label must not be empty.
+wizardExportAlignmentErrorNothingToExport=Either single reads or the consensus sequence have to be selected for export.
+wizardExportAlignmentExportConsensusSeqLabel=Export consensus sequence
+wizardExportAlignmentExportFormatLabel=Select the export format:
+wizardExportAlignmentExportSingleReads=Export single reads
+wizardExportAlignmentFileDialogTitle=Export to
+wizardExportAlignmentFileLabel=Alignment file:
+wizardExportAlignmentTitle=Sequence export
+wizardExportAlignmentWarningFileNameStartsDot=File starting with '.' are not supported on all operating systems.
+wizardExportAlignmentwarningMissingExtension=The file name does have a valid extension for the selected format.
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages_de.properties
new file mode 100644 (file)
index 0000000..f4f77d7
--- /dev/null
@@ -0,0 +1,16 @@
+wizardExportAlignmentAppendExtensionButton=Standarddateiendung anhängen
+wizardExportAlignmentBrowseButton=Durchsuchen...
+wizardExportAlignmentDataLabel=Zu exportierende Daten:
+wizardExportAlignmentDescription=Wählen Sie die zu exportierenden Daten aus.
+wizardExportAlignmentDestinationLabel=Zieldatei:
+wizardExportAlignmentErrorMissingFileName=Der Dateiname darf nicht leer sein.
+wizardExportAlignmentErrorMissingSeqLabel=Der Name der Konsensussequenz darf nicht leer sein.
+wizardExportAlignmentErrorNothingToExport=Es müssen entweder die einzelnen Reads oder die Konsensussequenz zum Export ausgewählt werden.
+wizardExportAlignmentExportConsensusSeqLabel=Konsensussequenz exportieren
+wizardExportAlignmentExportFormatLabel=Zielformat:
+wizardExportAlignmentExportSingleReads=Einzelne Reads exportieren
+wizardExportAlignmentFileDialogTitle=Exportieren nach
+wizardExportAlignmentFileLabel=Alignment Datei:
+wizardExportAlignmentTitle=Sequenzexport
+wizardExportAlignmentWarningFileNameStartsDot=Dateinamen, die mit einem '.' beginnen, werden nicht auf allen Betriebssystemen unterstützt.
+wizardExportAlignmentwarningMissingExtension=Der momentane Dateiname hat keine zum aktuellen Format passende Endung.
diff --git a/eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/Messages.java b/eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/Messages.java
new file mode 100644 (file)
index 0000000..f0d2813
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2016 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.taxeditor.molecular;
+
+
+import org.eclipse.osgi.util.NLS;
+
+
+
+/**
+ * Messages and texts for the molecular plugin.
+ *
+ * @author Ben Stöver
+ * @date 17.11.2016
+ */
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+    public static String wizardExportAlignmentAppendExtensionButton;
+    public static String wizardExportAlignmentBrowseButton;
+    public static String wizardExportAlignmentDataLabel;
+    public static String wizardExportAlignmentDescription;
+    public static String wizardExportAlignmentDestinationLabel;
+    public static String wizardExportAlignmentErrorMissingFileName;
+    public static String wizardExportAlignmentErrorMissingSeqLabel;
+    public static String wizardExportAlignmentErrorNothingToExport;
+    public static String wizardExportAlignmentExportConsensusSeqLabel;
+    public static String wizardExportAlignmentExportFormatLabel;
+    public static String wizardExportAlignmentExportSingleReads;
+    public static String wizardExportAlignmentFileDialogTitle;
+    public static String wizardExportAlignmentFileLabel;
+    public static String wizardExportAlignmentTitle;
+    public static String wizardExportAlignmentWarningFileNameStartsDot;
+    public static String wizardExportAlignmentwarningMissingExtension;
+
+
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {}
+}
index 6e80ee75aeaee35853d10e6d3b9cd9df1bf4eb6a..b6a702002370256cb5cec356c8724d1fb917a7d0 100644 (file)
@@ -38,6 +38,8 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;\r
 import org.eclipse.swt.widgets.Text;\r
 \r
+import eu.etaxonomy.taxeditor.molecular.Messages;\r
+\r
 \r
 \r
 /**\r
@@ -58,9 +60,9 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
      * Create the wizard.\r
      */\r
     public ExportSingleReadAlignmentWizardPage() {\r
-        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions?\r
-        setTitle("Sequence export");  //TODO multi language\r
-        setDescription("Defines which sequences of the single read alignment shall be exported.");  //TODO multi language\r
+        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions? //$NON-NLS-1$\r
+        setTitle(Messages.wizardExportAlignmentTitle);\r
+        setDescription(Messages.wizardExportAlignmentDescription);\r
     }\r
 \r
 \r
@@ -83,7 +85,7 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
         FormData fd_exportSingleReadsCB = new FormData();\r
         fd_exportSingleReadsCB.left = new FormAttachment(0, 10);\r
         exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);\r
-        exportSingleReadsCB.setText("Export single reads");\r
+        exportSingleReadsCB.setText(Messages.wizardExportAlignmentExportSingleReads);\r
         final ISWTObservableValue exportSingleReadsObservable = SWTObservables.observeSelection(exportSingleReadsCB);\r
         dbc.bindValue(exportSingleReadsObservable, getWizard().getModel().getExportSingleReadsObservable());\r
         exportSingleReadsCB.setSelection(false);\r
@@ -101,7 +103,7 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
         fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);\r
         fd_exportConsensusSequenceCB.left = new FormAttachment(0, 10);\r
         exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);\r
-        exportConsensusSequenceCB.setText("Export consensus sequence");\r
+        exportConsensusSequenceCB.setText(Messages.wizardExportAlignmentExportConsensusSeqLabel);\r
         final ISWTObservableValue exportConsensusSequenceObservable = SWTObservables.observeSelection(exportConsensusSequenceCB);\r
         dbc.bindValue(exportConsensusSequenceObservable, getWizard().getModel().getExportConsensusSequenceObservable());\r
         exportConsensusSequenceCB.setSelection(false);\r
@@ -116,14 +118,14 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
         consensusSequenceLabelTextField.setLayoutData(fd_consensusSequenceNameTextField);\r
         final ISWTObservableValue consensusSequenceLabelObservable = SWTObservables.observeText(consensusSequenceLabelTextField, SWT.Modify);\r
         dbc.bindValue(consensusSequenceLabelObservable, getWizard().getModel().getConsensusSequenceLabelObservable());\r
-        consensusSequenceLabelTextField.setText("ConsensusSequence");  // Must happen after the component has been bound to the model.\r
+        consensusSequenceLabelTextField.setText("ConsensusSequence");  // Must happen after the component has been bound to the model. //$NON-NLS-1$\r
 \r
         Label lblFormat = new Label(container, SWT.NONE);\r
         FormData fd_lblFormat = new FormData();\r
         fd_lblFormat.top = new FormAttachment(consensusSequenceLabelTextField, 36);\r
         fd_lblFormat.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);\r
         lblFormat.setLayoutData(fd_lblFormat);\r
-        lblFormat.setText("Select the export format:");  //TODO multi language\r
+        lblFormat.setText(Messages.wizardExportAlignmentExportFormatLabel);\r
 \r
         Label lblSelectTheData = new Label(container, SWT.NONE);\r
         fd_exportSingleReadsCB.top = new FormAttachment(lblSelectTheData, 6);\r
@@ -131,21 +133,21 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
         fd_lblSelectTheData.left = new FormAttachment(0, 10);\r
         fd_lblSelectTheData.top = new FormAttachment(0, 10);\r
         lblSelectTheData.setLayoutData(fd_lblSelectTheData);\r
-        lblSelectTheData.setText("Select the data to export:");  //TODO multi language\r
+        lblSelectTheData.setText(Messages.wizardExportAlignmentDataLabel);\r
 \r
         Label lblSelectTheExport = new Label(container, SWT.NONE);\r
         FormData fd_lblSelectTheExport = new FormData();\r
         fd_lblSelectTheExport.top = new FormAttachment(lblFormat, 57);\r
         fd_lblSelectTheExport.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);\r
         lblSelectTheExport.setLayoutData(fd_lblSelectTheExport);\r
-        lblSelectTheExport.setText("Select the export destination:");  //TODO multi language\r
+        lblSelectTheExport.setText(Messages.wizardExportAlignmentDestinationLabel);\r
 \r
         Label lblAlignmentFile = new Label(container, SWT.NONE);\r
         FormData fd_lblAlignmentFile = new FormData();\r
         fd_lblAlignmentFile.top = new FormAttachment(lblSelectTheExport, 9);\r
         fd_lblAlignmentFile.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);\r
         lblAlignmentFile.setLayoutData(fd_lblAlignmentFile);\r
-        lblAlignmentFile.setText("Alignment file:");  //TODO multi language\r
+        lblAlignmentFile.setText(Messages.wizardExportAlignmentFileLabel);\r
 \r
         fileTextField = new Text(container, SWT.BORDER);\r
         FormData fd_text = new FormData();\r
@@ -161,7 +163,7 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
             @Override\r
             public void widgetSelected(SelectionEvent e) {\r
                 FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);\r
-                dialog.setText("Export to");  //TODO multi language\r
+                dialog.setText(Messages.wizardExportAlignmentFileDialogTitle);\r
                 ContentExtensionFileFilter filter = getSelectedFormat().createFileFilter(TestStrategy.EXTENSION);\r
                 dialog.setFilterExtensions(new String[]{filter.getExtensionsAsString()});\r
                 dialog.setFilterNames(new String[]{filter.getDescription()});\r
@@ -177,7 +179,7 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
         fd_btnBrowse.top = new FormAttachment(fileTextField, 13);\r
         fd_btnBrowse.right = new FormAttachment(100, -10);\r
         btnBrowse.setLayoutData(fd_btnBrowse);\r
-        btnBrowse.setText("Browse...");\r
+        btnBrowse.setText(Messages.wizardExportAlignmentBrowseButton);\r
 \r
         formatComboBox = new Combo(container, SWT.READ_ONLY);\r
         for (JPhyloIOFormatInfo formatInfo : ExportSingleReadAlignmentWizardModel.FORMAT_NAMES_TO_INFO_MAP.values()) {\r
@@ -201,12 +203,12 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
             }\r
         });\r
         FormData fd_btnNewButton = new FormData();\r
-        fd_btnNewButton.left = new FormAttachment(btnBrowse, -217, SWT.LEFT);\r
+        fd_btnNewButton.left = new FormAttachment(btnBrowse, -276, SWT.LEFT);\r
         fd_btnNewButton.right = new FormAttachment(btnBrowse, -6);\r
         fd_btnNewButton.bottom = new FormAttachment(fileTextField, 43, SWT.BOTTOM);\r
         fd_btnNewButton.top = new FormAttachment(fileTextField, 13);\r
         appendExtensionButton.setLayoutData(fd_btnNewButton);\r
-        appendExtensionButton.setText("Append default extension");  //TODO multi language\r
+        appendExtensionButton.setText(Messages.wizardExportAlignmentAppendExtensionButton);\r
 \r
         dbc.addValidationStatusProvider(new MultiValidator() {\r
             @Override\r
@@ -216,22 +218,21 @@ public class ExportSingleReadAlignmentWizardPage extends WizardPage {
                 boolean exportReads = (Boolean)exportSingleReadsObservable.getValue();\r
 \r
                 if (!exportConsensus && !exportReads) {\r
-                    return ValidationStatus.error("Either single reads or the consensus sequence have to be selected for export.");  //TODO multi language\r
+                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorNothingToExport);\r
                 }\r
                 else if (exportConsensus && ((label == null) || label.isEmpty())) {\r
-                    return ValidationStatus.error("The consensus sequence label must not be empty.");  //TODO multi language\r
+                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingSeqLabel);\r
                 }\r
 \r
                 String fileName = (String)fileNameObservable.getValue();\r
                 if ((fileName == null) || fileName.isEmpty()) {\r
-                    return ValidationStatus.error("The file name must not be empty.");  //TODO multi language\r
+                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingFileName);\r
                 }\r
                 else if (!getSelectedFormat().createFileFilter(TestStrategy.EXTENSION).accept(new File(fileName))) {\r
-                    return ValidationStatus.warning("The file name does have a valid extension for the selected format.");  //TODO multi language\r
+                    return ValidationStatus.warning(Messages.wizardExportAlignmentwarningMissingExtension);\r
                 }\r
                 else if (fileName.charAt(0) == ExtensionFileFilter.EXTENSION_SEPARATOR) {\r
-                    return ValidationStatus.warning("File starting with '" + ExtensionFileFilter.EXTENSION_SEPARATOR +\r
-                            "' are not supported on all operating systems.");  //TODO multi language\r
+                    return ValidationStatus.warning(Messages.wizardExportAlignmentWarningFileNameStartsDot);\r
                 }\r
                 else {\r
                     return ValidationStatus.ok();\r