Project

General

Profile

« Previous | Next » 

Revision d0c85dbc

Added by Ben Stöver over 7 years ago

Strings in ExportSingleReadAlignmentWizardPage externalized and translated.

View differences:

eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages.properties
1
wizardExportAlignmentAppendExtensionButton=Append default extension
2
wizardExportAlignmentBrowseButton=Browse...
3
wizardExportAlignmentDataLabel=Select the data to export:
4
wizardExportAlignmentDescription=Defines which data of the single read alignment shall be exported.
5
wizardExportAlignmentDestinationLabel=Select the export destination:
6
wizardExportAlignmentErrorMissingFileName=The file name must not be empty.
7
wizardExportAlignmentErrorMissingSeqLabel=The consensus sequence label must not be empty.
8
wizardExportAlignmentErrorNothingToExport=Either single reads or the consensus sequence have to be selected for export.
9
wizardExportAlignmentExportConsensusSeqLabel=Export consensus sequence
10
wizardExportAlignmentExportFormatLabel=Select the export format:
11
wizardExportAlignmentExportSingleReads=Export single reads
12
wizardExportAlignmentFileDialogTitle=Export to
13
wizardExportAlignmentFileLabel=Alignment file:
14
wizardExportAlignmentTitle=Sequence export
15
wizardExportAlignmentWarningFileNameStartsDot=File starting with '.' are not supported on all operating systems.
16
wizardExportAlignmentwarningMissingExtension=The file name does have a valid extension for the selected format.
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/messages_de.properties
1
wizardExportAlignmentAppendExtensionButton=Standarddateiendung anh?ngen
2
wizardExportAlignmentBrowseButton=Durchsuchen...
3
wizardExportAlignmentDataLabel=Zu exportierende Daten:
4
wizardExportAlignmentDescription=W?hlen Sie die zu exportierenden Daten aus.
5
wizardExportAlignmentDestinationLabel=Zieldatei:
6
wizardExportAlignmentErrorMissingFileName=Der Dateiname darf nicht leer sein.
7
wizardExportAlignmentErrorMissingSeqLabel=Der Name der Konsensussequenz darf nicht leer sein.
8
wizardExportAlignmentErrorNothingToExport=Es m?ssen entweder die einzelnen Reads oder die Konsensussequenz zum Export ausgew?hlt werden.
9
wizardExportAlignmentExportConsensusSeqLabel=Konsensussequenz exportieren
10
wizardExportAlignmentExportFormatLabel=Zielformat:
11
wizardExportAlignmentExportSingleReads=Einzelne Reads exportieren
12
wizardExportAlignmentFileDialogTitle=Exportieren nach
13
wizardExportAlignmentFileLabel=Alignment Datei:
14
wizardExportAlignmentTitle=Sequenzexport
15
wizardExportAlignmentWarningFileNameStartsDot=Dateinamen, die mit einem '.' beginnen, werden nicht auf allen Betriebssystemen unterst?tzt.
16
wizardExportAlignmentwarningMissingExtension=Der momentane Dateiname hat keine zum aktuellen Format passende Endung.
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/Messages.java
1
/**
2
 * Copyright (C) 2016 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9
package eu.etaxonomy.taxeditor.molecular;
10

  
11

  
12
import org.eclipse.osgi.util.NLS;
13

  
14

  
15

  
16
/**
17
 * Messages and texts for the molecular plugin.
18
 *
19
 * @author Ben Stöver
20
 * @date 17.11.2016
21
 */
22
public class Messages extends NLS {
23
    private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
24
    public static String wizardExportAlignmentAppendExtensionButton;
25
    public static String wizardExportAlignmentBrowseButton;
26
    public static String wizardExportAlignmentDataLabel;
27
    public static String wizardExportAlignmentDescription;
28
    public static String wizardExportAlignmentDestinationLabel;
29
    public static String wizardExportAlignmentErrorMissingFileName;
30
    public static String wizardExportAlignmentErrorMissingSeqLabel;
31
    public static String wizardExportAlignmentErrorNothingToExport;
32
    public static String wizardExportAlignmentExportConsensusSeqLabel;
33
    public static String wizardExportAlignmentExportFormatLabel;
34
    public static String wizardExportAlignmentExportSingleReads;
35
    public static String wizardExportAlignmentFileDialogTitle;
36
    public static String wizardExportAlignmentFileLabel;
37
    public static String wizardExportAlignmentTitle;
38
    public static String wizardExportAlignmentWarningFileNameStartsDot;
39
    public static String wizardExportAlignmentwarningMissingExtension;
40

  
41

  
42
    static {
43
        // initialize resource bundle
44
        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
45
    }
46

  
47
    private Messages() {}
48
}
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java
38 38
import org.eclipse.swt.widgets.Label;
39 39
import org.eclipse.swt.widgets.Text;
40 40

  
41
import eu.etaxonomy.taxeditor.molecular.Messages;
42

  
41 43

  
42 44

  
43 45
/**
......
58 60
     * Create the wizard.
59 61
     */
60 62
    public ExportSingleReadAlignmentWizardPage() {
61
        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions?
62
        setTitle("Sequence export");  //TODO multi language
63
        setDescription("Defines which sequences of the single read alignment shall be exported.");  //TODO multi language
63
        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions? //$NON-NLS-1$
64
        setTitle(Messages.wizardExportAlignmentTitle);
65
        setDescription(Messages.wizardExportAlignmentDescription);
64 66
    }
65 67

  
66 68

  
......
83 85
        FormData fd_exportSingleReadsCB = new FormData();
84 86
        fd_exportSingleReadsCB.left = new FormAttachment(0, 10);
85 87
        exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);
86
        exportSingleReadsCB.setText("Export single reads");
88
        exportSingleReadsCB.setText(Messages.wizardExportAlignmentExportSingleReads);
87 89
        final ISWTObservableValue exportSingleReadsObservable = SWTObservables.observeSelection(exportSingleReadsCB);
88 90
        dbc.bindValue(exportSingleReadsObservable, getWizard().getModel().getExportSingleReadsObservable());
89 91
        exportSingleReadsCB.setSelection(false);
......
101 103
        fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);
102 104
        fd_exportConsensusSequenceCB.left = new FormAttachment(0, 10);
103 105
        exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);
104
        exportConsensusSequenceCB.setText("Export consensus sequence");
106
        exportConsensusSequenceCB.setText(Messages.wizardExportAlignmentExportConsensusSeqLabel);
105 107
        final ISWTObservableValue exportConsensusSequenceObservable = SWTObservables.observeSelection(exportConsensusSequenceCB);
106 108
        dbc.bindValue(exportConsensusSequenceObservable, getWizard().getModel().getExportConsensusSequenceObservable());
107 109
        exportConsensusSequenceCB.setSelection(false);
......
116 118
        consensusSequenceLabelTextField.setLayoutData(fd_consensusSequenceNameTextField);
117 119
        final ISWTObservableValue consensusSequenceLabelObservable = SWTObservables.observeText(consensusSequenceLabelTextField, SWT.Modify);
118 120
        dbc.bindValue(consensusSequenceLabelObservable, getWizard().getModel().getConsensusSequenceLabelObservable());
119
        consensusSequenceLabelTextField.setText("ConsensusSequence");  // Must happen after the component has been bound to the model.
121
        consensusSequenceLabelTextField.setText("ConsensusSequence");  // Must happen after the component has been bound to the model. //$NON-NLS-1$
120 122

  
121 123
        Label lblFormat = new Label(container, SWT.NONE);
122 124
        FormData fd_lblFormat = new FormData();
123 125
        fd_lblFormat.top = new FormAttachment(consensusSequenceLabelTextField, 36);
124 126
        fd_lblFormat.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
125 127
        lblFormat.setLayoutData(fd_lblFormat);
126
        lblFormat.setText("Select the export format:");  //TODO multi language
128
        lblFormat.setText(Messages.wizardExportAlignmentExportFormatLabel);
127 129

  
128 130
        Label lblSelectTheData = new Label(container, SWT.NONE);
129 131
        fd_exportSingleReadsCB.top = new FormAttachment(lblSelectTheData, 6);
......
131 133
        fd_lblSelectTheData.left = new FormAttachment(0, 10);
132 134
        fd_lblSelectTheData.top = new FormAttachment(0, 10);
133 135
        lblSelectTheData.setLayoutData(fd_lblSelectTheData);
134
        lblSelectTheData.setText("Select the data to export:");  //TODO multi language
136
        lblSelectTheData.setText(Messages.wizardExportAlignmentDataLabel);
135 137

  
136 138
        Label lblSelectTheExport = new Label(container, SWT.NONE);
137 139
        FormData fd_lblSelectTheExport = new FormData();
138 140
        fd_lblSelectTheExport.top = new FormAttachment(lblFormat, 57);
139 141
        fd_lblSelectTheExport.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
140 142
        lblSelectTheExport.setLayoutData(fd_lblSelectTheExport);
141
        lblSelectTheExport.setText("Select the export destination:");  //TODO multi language
143
        lblSelectTheExport.setText(Messages.wizardExportAlignmentDestinationLabel);
142 144

  
143 145
        Label lblAlignmentFile = new Label(container, SWT.NONE);
144 146
        FormData fd_lblAlignmentFile = new FormData();
145 147
        fd_lblAlignmentFile.top = new FormAttachment(lblSelectTheExport, 9);
146 148
        fd_lblAlignmentFile.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
147 149
        lblAlignmentFile.setLayoutData(fd_lblAlignmentFile);
148
        lblAlignmentFile.setText("Alignment file:");  //TODO multi language
150
        lblAlignmentFile.setText(Messages.wizardExportAlignmentFileLabel);
149 151

  
150 152
        fileTextField = new Text(container, SWT.BORDER);
151 153
        FormData fd_text = new FormData();
......
161 163
            @Override
162 164
            public void widgetSelected(SelectionEvent e) {
163 165
                FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
164
                dialog.setText("Export to");  //TODO multi language
166
                dialog.setText(Messages.wizardExportAlignmentFileDialogTitle);
165 167
                ContentExtensionFileFilter filter = getSelectedFormat().createFileFilter(TestStrategy.EXTENSION);
166 168
                dialog.setFilterExtensions(new String[]{filter.getExtensionsAsString()});
167 169
                dialog.setFilterNames(new String[]{filter.getDescription()});
......
177 179
        fd_btnBrowse.top = new FormAttachment(fileTextField, 13);
178 180
        fd_btnBrowse.right = new FormAttachment(100, -10);
179 181
        btnBrowse.setLayoutData(fd_btnBrowse);
180
        btnBrowse.setText("Browse...");
182
        btnBrowse.setText(Messages.wizardExportAlignmentBrowseButton);
181 183

  
182 184
        formatComboBox = new Combo(container, SWT.READ_ONLY);
183 185
        for (JPhyloIOFormatInfo formatInfo : ExportSingleReadAlignmentWizardModel.FORMAT_NAMES_TO_INFO_MAP.values()) {
......
201 203
            }
202 204
        });
203 205
        FormData fd_btnNewButton = new FormData();
204
        fd_btnNewButton.left = new FormAttachment(btnBrowse, -217, SWT.LEFT);
206
        fd_btnNewButton.left = new FormAttachment(btnBrowse, -276, SWT.LEFT);
205 207
        fd_btnNewButton.right = new FormAttachment(btnBrowse, -6);
206 208
        fd_btnNewButton.bottom = new FormAttachment(fileTextField, 43, SWT.BOTTOM);
207 209
        fd_btnNewButton.top = new FormAttachment(fileTextField, 13);
208 210
        appendExtensionButton.setLayoutData(fd_btnNewButton);
209
        appendExtensionButton.setText("Append default extension");  //TODO multi language
211
        appendExtensionButton.setText(Messages.wizardExportAlignmentAppendExtensionButton);
210 212

  
211 213
        dbc.addValidationStatusProvider(new MultiValidator() {
212 214
            @Override
......
216 218
                boolean exportReads = (Boolean)exportSingleReadsObservable.getValue();
217 219

  
218 220
                if (!exportConsensus && !exportReads) {
219
                    return ValidationStatus.error("Either single reads or the consensus sequence have to be selected for export.");  //TODO multi language
221
                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorNothingToExport);
220 222
                }
221 223
                else if (exportConsensus && ((label == null) || label.isEmpty())) {
222
                    return ValidationStatus.error("The consensus sequence label must not be empty.");  //TODO multi language
224
                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingSeqLabel);
223 225
                }
224 226

  
225 227
                String fileName = (String)fileNameObservable.getValue();
226 228
                if ((fileName == null) || fileName.isEmpty()) {
227
                    return ValidationStatus.error("The file name must not be empty.");  //TODO multi language
229
                    return ValidationStatus.error(Messages.wizardExportAlignmentErrorMissingFileName);
228 230
                }
229 231
                else if (!getSelectedFormat().createFileFilter(TestStrategy.EXTENSION).accept(new File(fileName))) {
230
                    return ValidationStatus.warning("The file name does have a valid extension for the selected format.");  //TODO multi language
232
                    return ValidationStatus.warning(Messages.wizardExportAlignmentwarningMissingExtension);
231 233
                }
232 234
                else if (fileName.charAt(0) == ExtensionFileFilter.EXTENSION_SEPARATOR) {
233
                    return ValidationStatus.warning("File starting with '" + ExtensionFileFilter.EXTENSION_SEPARATOR +
234
                            "' are not supported on all operating systems.");  //TODO multi language
235
                    return ValidationStatus.warning(Messages.wizardExportAlignmentWarningFileNameStartsDot);
235 236
                }
236 237
                else {
237 238
                    return ValidationStatus.ok();

Also available in: Unified diff