translated some more error messages

This commit is contained in:
hneemann 2017-03-10 13:22:09 +01:00
parent 78d6d48d83
commit 93e974cc19
6 changed files with 33 additions and 17 deletions

View File

@ -14,7 +14,6 @@ public class CreateCHN implements ExpressionToFileExporter.PostProcess {
@Override
public File execute(File file) throws IOException {
File chnFile = Main.checkSuffix(file, "chn");
System.out.println("create chn from " + file);
try (Writer chn = new OutputStreamWriter(new FileOutputStream(chnFile), "UTF-8")) {
chn.write("1 4 1 0 \r\n"

View File

@ -1,5 +1,7 @@
package de.neemann.digital.builder.tt2;
import de.neemann.digital.lang.Lang;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@ -73,11 +75,11 @@ public class OSExecute {
if (p.isAlive()) {
p.destroy();
sr.interrupt();
throw new IOException("Process does not terminate!");
throw new IOException(Lang.get("err_processDoesNotTerminate_N", procesBuilder.command()));
}
if (p.exitValue() != 0)
throw new IOException("got non zero exit value " + p.exitValue());
throw new IOException(Lang.get("err_processExitedWithError_N1_N2", p.exitValue(), "\n"+sr.toString()));
try {
sr.join();

View File

@ -31,21 +31,25 @@ public class StartFitter implements ExpressionToFileExporter.PostProcess {
@Override
public File execute(File file) throws IOException {
ArrayList<String> args = new ArrayList<>();
try {
ArrayList<String> args = new ArrayList<>();
if (isLinux())
args.add("wine");
args.add(fitterExe.toString());
args.add(file.getName());
if (isLinux())
args.add("wine");
args.add(fitterExe.toString());
args.add(file.getName());
OSExecute execute = new OSExecute(args);
execute.setWorkingDir(file.getParentFile());
OSExecute execute = new OSExecute(args);
execute.setWorkingDir(file.getParentFile());
String message = execute.start();
String message = execute.start();
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(parent, message, Lang.get("msg_fitterResult"), JOptionPane.INFORMATION_MESSAGE));
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(parent, message, Lang.get("msg_fitterResult"), JOptionPane.INFORMATION_MESSAGE));
return Main.checkSuffix(file, "jed");
return Main.checkSuffix(file, "jed");
} catch (IOException e) {
throw new IOException(Lang.get("err_errorRunningFitter"), e);
}
}
private boolean isLinux() {

View File

@ -42,6 +42,7 @@ import de.neemann.digital.lang.Lang;
import de.neemann.digital.testing.TestCaseElement;
import de.neemann.digital.testing.TestingDataException;
import de.neemann.gui.*;
import de.neemann.gui.language.Language;
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
@ -445,10 +446,14 @@ public class Main extends JFrame implements ClosingWindowListener.ConfirmSave, E
ToolTipAction editSettings = new ToolTipAction(Lang.get("menu_editSettings")) {
@Override
public void actionPerformed(ActionEvent e) {
Language oldLang = Settings.getInstance().get(Keys.SETTINGS_LANGUAGE);
if (new AttributeDialog(Main.this, Settings.SETTINGS_KEYS, Settings.getInstance().getAttributes()).showDialog()) {
Lang.setLanguage(Settings.getInstance().getAttributes().get(Keys.SETTINGS_LANGUAGE));
FormatToExpression.setDefaultFormat(Settings.getInstance().get(Keys.SETTINGS_EXPRESSION_FORMAT));
JOptionPane.showMessageDialog(Main.this, Lang.get("msg_restartNeeded"));
final Language newLang = Settings.getInstance().getAttributes().get(Keys.SETTINGS_LANGUAGE);
if (!newLang.equals(oldLang)) {
Lang.setLanguage(newLang);
JOptionPane.showMessageDialog(Main.this, Lang.get("msg_restartNeeded"));
}
}
}
}.setToolTip(Lang.get("menu_editSettings_tt"));

View File

@ -433,6 +433,9 @@ Zur Analyse können Sie die Schaltung im Gatterschrittmodus ausführen.</string>
<string name="err_file_N0_ExistsTwiceBelow_N1">Die Datei {0} existiert mehrfach unter {1}</string>
<string name="err_couldNotFindIncludedFile_N0">Die Datei {0} konnte nicht gefunden werden.</string>
<string name="err_postProcessErrorIn_N0">Fehler im Bearbeitungsschritt &quot;{0}&quot;.</string>
<string name="err_processDoesNotTerminate_N">Der Prozess &quot;{0}&quot; wird nicht beendet!</string>
<string name="err_processExitedWithError_N1_N2">Der Prozess meldet den Rückgabewert {0}: {1}</string>
<string name="err_errorRunningFitter">Fehler beim Starten des externen Fitters!</string>
<string name="key_AddrBits">Adress-Bits</string>
<string name="key_AddrBits_tt">Anzahl der Adress-Bits die verwendet werden.</string>
@ -689,7 +692,7 @@ Die Icons stammen aus dem Tango Desktop Project.</string>
<string name="msg_missingShape_N">Es fehlt ein Diagramm für {0}</string>
<string name="msg_pins">Pinbelegung</string>
<string name="msg_pinMap_pin_N_is_N">Pin {0}: {1}</string>
<string name="msg_restartNeeded">Die Änderung erfordert einen Neustart!</string>
<string name="msg_restartNeeded">Die Änderung der Sprache erfordert einen Neustart!</string>
<string name="msg_noRomFound">Kein ROM im Model gefunden! Ein ROM muss als Programmspeicher gewählt werden!</string>
<string name="msg_moreThenOneRomFound">Mehr als einen Programmspeicher gefunden. Es darf nur einen Programmspeicher geben.</string>
<string name="msg_enterAnExpression">Geben Sie einen Ausdruck ein:</string>

View File

@ -419,6 +419,9 @@ To analyse you can run the circuit in single gate step mode.</string>
<string name="err_file_N0_ExistsTwiceBelow_N1">The file {0} exists multiple times below {1}.</string>
<string name="err_couldNotFindIncludedFile_N0">Could not find the file {0}.</string>
<string name="err_postProcessErrorIn_N0">Error during execution of &quot;{0}&quot;.</string>
<string name="err_processDoesNotTerminate_N">The process &quot;{0}&quot; does not return!</string>
<string name="err_processExitedWithError_N1_N2">The process returns the non zero value {0}: {1}</string>
<string name="err_errorRunningFitter">Error starting the external fitter!</string>
<string name="key_AddrBits">Address Bits</string>
<string name="key_AddrBits_tt">Number of address bits used.</string>
@ -674,7 +677,7 @@ The icons are taken from the Tango Desktop Project.</string>
<string name="msg_missingShape_N">Shape {0} is missing</string>
<string name="msg_pins">Pin assignment</string>
<string name="msg_pinMap_pin_N_is_N">Pin {0}: {1}</string>
<string name="msg_restartNeeded">Change needs a restart to take effect!</string>
<string name="msg_restartNeeded">To change the GUI language a restart is required!</string>
<string name="msg_noRomFound">No ROM found! ROM needs to be set to be program memory.</string>
<string name="msg_moreThenOneRomFound">More then one ROM found! Only one ROM must be set to be program memory.</string>
<string name="msg_remoteUnknownCommand">Command {0} unknown!</string>