Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed minor localisation problems #339

Merged
merged 8 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2022 Lablicate GmbH.
* Copyright (c) 2017, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -28,6 +28,7 @@
import org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings;
import org.eclipse.swtchart.extensions.core.SecondaryAxisSettings;
import org.eclipse.swtchart.extensions.linecharts.LineChart;
import org.eclipse.swtchart.extensions.menu.ResetChartHandler;

public class ChromatogramChart extends LineChart {

Expand All @@ -54,6 +55,8 @@ private void initialize() {
chartSettings.setVerticalSliderVisible(true);
chartSettings.getRangeRestriction().setZeroX(true);
chartSettings.getRangeRestriction().setZeroY(true);
chartSettings.removeMenuEntry(chartSettings.getChartMenuEntryByClass(ResetChartHandler.class));
chartSettings.addMenuEntry(new ResetChromatogramHandler());
//
setPrimaryAxisSet(chartSettings);
addSecondaryAxisSet(chartSettings);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 SWT Chart Project
* Copyright (c) 2020, 2023 SWT Chart Project
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -18,11 +18,13 @@
public class Messages {

private static final String BUNDLE_NAME = "org.eclipse.swtchart.customcharts.core.messages"; //$NON-NLS-1$
//
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
public static String INTENSITY = "INTENSITY";
public static String MINUTES = "MINUTES";
public static String RELATIVE_INTENSITY = "RELATIVE_INTENSITY";
public static String RETENTION_TIME = "RETENTION_TIME";
public static String RESET_CHROMATOGRAM = "RESET_CHROMATOGRAM";;

private Messages() {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Matthias Mailänder - initial API and implementation
*******************************************************************************/
package org.eclipse.swtchart.customcharts.core;

import org.eclipse.swtchart.extensions.menu.ResetChartHandler;

public class ResetChromatogramHandler extends ResetChartHandler {

@Override
public String getName() {

return Messages.getString(Messages.RESET_CHROMATOGRAM);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ INTENSITY = Intensity
MINUTES = Minutes
RELATIVE_INTENSITY = Relative Intensity [%]
RETENTION_TIME = Retention Time (milliseconds)
RESET_CHROMATOGRAM = Reset Chromatogram
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ INTENSITY = Intensit
MINUTES = Minuten
RELATIVE_INTENSITY = Relative Intensit�t [%]
RETENTION_TIME = Retentionszeit (Milisekunden)
RESET_CHROMATOGRAM = Chromatogram zur�cksetzen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2021 Lablicate GmbH.
* Copyright (c) 2019, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -15,9 +15,11 @@
package org.eclipse.swtchart.export.extended.menu.vector;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.text.MessageFormat;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
Expand All @@ -37,7 +39,7 @@
public class SVGExportHandler extends AbstractSeriesExportHandler implements ISeriesExportConverter {

private static final String FILE_EXTENSION = "*.svg"; //$NON-NLS-1$
private static final String NAME = Messages.getString(Messages.SVG) + FILE_EXTENSION + ")"; //$NON-NLS-1$
private static final String NAME = MessageFormat.format(Messages.getString(Messages.SVG), FILE_EXTENSION);
private static final String TITLE = Messages.getString(Messages.SAVE_AS_SVG);

@Override
Expand Down Expand Up @@ -71,32 +73,32 @@ public void execute(Shell shell, ScrollableChart scrollableChart) {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {

try {
monitor.beginTask(Messages.getString(Messages.EXPORT_TO_SVG), IProgressMonitor.UNKNOWN);
monitor.beginTask(Messages.EXPORT_TO_SVG, IProgressMonitor.UNKNOWN);
try (Writer output = new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8")) { //$NON-NLS-1$
boolean useCSS = true;
Writer output = new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8"); //$NON-NLS-1$
SVGFactory svgFactory = new SVGFactory();
svgFactory.createSvg(baseChart, indexAxisX, indexAxisY);
if(svgFactory.stream(output, useCSS)) {
MessageDialog.openInformation(fileDialog.getParent(), TITLE, MESSAGE_OK);
} else {
MessageDialog.openInformation(fileDialog.getParent(), TITLE, MESSAGE_ERROR);
}
} catch(Exception e) {
} catch(IOException e) {
e.printStackTrace();
} finally {
monitor.done();
}
}
});
} catch(Exception e) {
} catch(InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
}
}
} catch(Exception e) {
} catch(InvocationTargetException e) {
MessageDialog.openInformation(shell, TITLE, MESSAGE_ERROR);
e.printStackTrace();
e.getCause().printStackTrace();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class VectorExportSettingsDialog extends TitleAreaDialog {
* The use might modify the current settings.
* Hence, cache the original settings.
*/
private Map<String, ISeriesSettings> cachedSeriesSettings = new HashMap<String, ISeriesSettings>();
private Map<String, ISeriesSettings> cachedSeriesSettings = new HashMap<>();
//
private Combo comboScaleX;
private Combo comboScaleY;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2021 Lablicate GmbH.
* Copyright (c) 2017, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,17 +13,19 @@
*******************************************************************************/
package org.eclipse.swtchart.export.menu.bitmap;

import java.text.MessageFormat;

import org.eclipse.swt.SWT;

public class BMPExportHandler extends AbstractBitmapExportHandler {

private static final String FILE_EXTENSION = "*.bmp"; //$NON-NLS-1$
public static final String NAME = Messages.getString(Messages.IMAGE) + FILE_EXTENSION + ")"; //$NON-NLS-1$
public static final String NAME = MessageFormat.format(Messages.getString(Messages.IMAGE), FILE_EXTENSION);
private static final String TITLE = Messages.getString(Messages.SAVE_AS_IMAGE);
private static final String[] FILTER_EXTENSIONS = new String[]{"*.bmp"}; //$NON-NLS-1$ //$NON-NLS-2$

public BMPExportHandler() {

super(NAME, TITLE, FILTER_EXTENSIONS, SWT.IMAGE_BMP);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022 Lablicate GmbH.
* Copyright (c) 2022, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -25,7 +25,7 @@ public class ClipboardExportHandler extends AbstractSeriesExportHandler implemen
@Override
public String getName() {

return "Copy Image to Clipboard";
return Messages.getString(Messages.COPY_IMAGE_TO_CLIPBOARD);
}

@Override
Expand All @@ -39,4 +39,4 @@ public void execute(Shell shell, ScrollableChart scrollableChart) {

ImageClipboardSupport.transfer(shell.getDisplay(), scrollableChart.getBaseChart());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2021 Lablicate GmbH.
* Copyright (c) 2017, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,17 +13,19 @@
*******************************************************************************/
package org.eclipse.swtchart.export.menu.bitmap;

import java.text.MessageFormat;

import org.eclipse.swt.SWT;

public class JPGExportHandler extends AbstractBitmapExportHandler {

private static final String FILE_EXTENSION = "*.jpg"; //$NON-NLS-1$
public static final String NAME = Messages.getString(Messages.IMAGE) + FILE_EXTENSION + ")"; //$NON-NLS-1$
public static final String NAME = MessageFormat.format(Messages.getString(Messages.IMAGE), FILE_EXTENSION);
private static final String TITLE = Messages.getString(Messages.SAVE_AS_IMAGE);
private static final String[] FILTER_EXTENSIONS = new String[]{"*.jpeg", "*.jpg"}; //$NON-NLS-1$ //$NON-NLS-2$

public JPGExportHandler() {

super(NAME, TITLE, FILTER_EXTENSIONS, SWT.IMAGE_JPEG);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 SWT Chart Project
* Copyright (c) 2020, 2023 SWT Chart Project
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,7 +10,6 @@
* Contributors:
* Frank Buloup - initial API and implementation
*******************************************************************************/

package org.eclipse.swtchart.export.menu.bitmap;

import java.util.MissingResourceException;
Expand All @@ -20,10 +19,11 @@ public class Messages {

private static final String BUNDLE_NAME = "org.eclipse.swtchart.export.menu.bitmap.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);

//
public static final String IMAGE = "IMAGE";
public static final String SAVE_AS_IMAGE = "SAVE_AS_IMAGE";

public static final String COPY_IMAGE_TO_CLIPBOARD = "COPY_IMAGE_TO_CLIPBOARD";

private Messages() {

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2021 Lablicate GmbH.
* Copyright (c) 2017, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,17 +12,19 @@
*******************************************************************************/
package org.eclipse.swtchart.export.menu.bitmap;

import java.text.MessageFormat;

import org.eclipse.swt.SWT;

public class PNGExportHandler extends AbstractBitmapExportHandler {

private static final String FILE_EXTENSION = "*.png"; //$NON-NLS-1$
public static final String NAME = Messages.getString("IMAGE") + FILE_EXTENSION + ")"; //$NON-NLS-1$ //$NON-NLS-2$
public static final String NAME = MessageFormat.format(Messages.getString(Messages.IMAGE), FILE_EXTENSION);
private static final String TITLE = Messages.getString("SAVE_AS_IMAGE"); //$NON-NLS-1$
private static final String[] FILTER_EXTENSIONS = new String[]{"*.png"}; //$NON-NLS-1$ //$NON-NLS-2$

public PNGExportHandler() {

super(NAME, TITLE, FILTER_EXTENSIONS, SWT.IMAGE_PNG);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
IMAGE = Image (
IMAGE = Image ({0})
SAVE_AS_IMAGE = Save As Image
COPY_IMAGE_TO_CLIPBOARD = Copy Image to Clipboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
IMAGE = Bild ({0})
SAVE_AS_IMAGE = Als Bild speichern
COPY_IMAGE_TO_CLIPBOARD = Bild in Zwischenablage kopieren
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
IMAGE = Image (
IMAGE = Image ({0})
SAVE_AS_IMAGE = Enregistrer en image
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* * Copyright (c) 2017, 2022 Lablicate GmbH.
* * Copyright (c) 2017, 2023 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.swtchart.export.menu.text;

import java.text.MessageFormat;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swtchart.export.core.AbstractSeparatedValueHandler;
import org.eclipse.swtchart.export.core.ISeriesExportConverter;
Expand All @@ -21,7 +23,7 @@
public class CSVExportHandler extends AbstractSeparatedValueHandler implements ISeriesExportConverter {

private static final String FILE_EXTENSION = "*.csv"; //$NON-NLS-1$
public static final String NAME = Messages.getString(Messages.COMMA_SEPARATED_VALUES) + FILE_EXTENSION + ")"; //$NON-NLS-1$
public static final String NAME = MessageFormat.format(Messages.getString(Messages.COMMA_SEPARATED_VALUES), FILE_EXTENSION);
//
private static final String TITLE = Messages.getString(Messages.SAVE_AS_COMMA_SEPARATED);
private static final String DELIMITER = ","; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.MessageFormat;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
Expand All @@ -40,7 +41,7 @@
public class LaTeXTableExportHandler extends AbstractSeriesExportHandler implements ISeriesExportConverter {

private static final String FILE_EXTENSION = "*.tex"; //$NON-NLS-1$
public static final String NAME = Messages.getString(Messages.LATEX_TABLE) + FILE_EXTENSION + ")"; //$NON-NLS-1$
public static final String NAME = MessageFormat.format(Messages.getString(Messages.LATEX_TABLE), FILE_EXTENSION);
//
private static final String TITLE = Messages.getString(Messages.SAVE_AS_LATEX);
private static final String TAB = "\t"; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -50,8 +51,8 @@

public class RScriptExportHandler extends AbstractSeriesExportHandler implements ISeriesExportConverter {

private static final String FILE_EXTENSION = Messages.getString(Messages.R_EXTENSION);
public static final String NAME = Messages.getString(Messages.IMAGE_R_SCRIPT) + FILE_EXTENSION + ")"; //$NON-NLS-1$
private static final String FILE_EXTENSION = "*.R"; //$NON-NLS-1$
public static final String NAME = MessageFormat.format(Messages.getString(Messages.IMAGE_R_SCRIPT), FILE_EXTENSION);
//
private static final String TITLE = Messages.getString(Messages.SAVE_AS_IMAGE_R_SCRIPT);
//
Expand Down
Loading