started translation
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>BelegScanner</groupId>
|
||||
<artifactId>BelegScanner</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
|
||||
<name>BelegScanner</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Category : Kategorie
|
||||
CATEGORY : KATEGORIE
|
||||
DAY : TAG
|
||||
height : Höhe
|
||||
Finished text recognition. : Texterkennung beendet.
|
||||
MONTH : MONAT
|
||||
Path : Pfad
|
||||
Press Shift + Delete to remove an entry. : Drücken Sie Umschalt + Entf um einen Eintrag zu löschen
|
||||
scanning… : Scanne…
|
||||
width : Breite
|
||||
YEAR : JAHR
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.srsoftware.belegscanner;
|
||||
import java.io.IOException;
|
||||
|
||||
import de.srsoftware.belegscanner.gui.MainFrame;
|
||||
import de.srsoftware.tools.translations.Translation;
|
||||
|
||||
public class Application {
|
||||
|
||||
@@ -11,4 +12,8 @@ public class Application {
|
||||
MainFrame app = new MainFrame(config);
|
||||
app.setDefaultCloseOperation(MainFrame.EXIT_ON_CLOSE);
|
||||
}
|
||||
|
||||
public static String t(String txt, Object...fills) {
|
||||
return Translation.get(Application.class, txt, fills);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.json.JSONArray;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static de.srsoftware.belegscanner.Application.*;
|
||||
import de.srsoftware.belegscanner.Configuration;
|
||||
|
||||
|
||||
@@ -160,7 +161,7 @@ public class MainFrame extends JFrame {
|
||||
builder.directory(folder);
|
||||
try {
|
||||
Process process = builder.start();
|
||||
docTable.setState(path,"Scanne…");
|
||||
docTable.setState(path,t("scanning…"));
|
||||
int errorCode = process.waitFor();
|
||||
if (errorCode != 0) {
|
||||
LOG.error("error code: {} for {}",errorCode,cmd);
|
||||
@@ -228,7 +229,7 @@ public class MainFrame extends JFrame {
|
||||
LOG.error("{} terminated: ",builder,e);
|
||||
}
|
||||
Path.of(path, pdf).toFile().delete();
|
||||
docTable.setState(path,"Texterkennung beendet.");
|
||||
docTable.setState(path,t("Finished text recognition."));
|
||||
docTable.preview(path);
|
||||
}
|
||||
|
||||
@@ -337,11 +338,11 @@ public class MainFrame extends JFrame {
|
||||
int year = 1900+date.getYear();
|
||||
int month = date.getMonth()+1;
|
||||
int day = date.getDate();
|
||||
patchedPath = path.replace("$HOME",HOME)
|
||||
.replace("$KATEGORIE", category)
|
||||
.replace("$JAHR", year+"")
|
||||
.replace("$MONAT", month<10 ? "0"+month : ""+month)
|
||||
.replace("$TAG", day < 10 ? "0"+day : ""+day);
|
||||
patchedPath = path.replace("$"+t("HOME"),HOME)
|
||||
.replace("$"+t("CATEGORY"), category)
|
||||
.replace("$"+t("YEAR"), year+"")
|
||||
.replace("$"+t("MONTH"), month<10 ? "0"+month : ""+month)
|
||||
.replace("$"+t("DAY"), day < 10 ? "0"+day : ""+day);
|
||||
|
||||
addFieldsFor(patchedPath);
|
||||
for (Entry<String, String> entry : fields.entrySet()) patchedPath = patchedPath.replace("$"+entry.getKey(), entry.getValue());
|
||||
|
||||
@@ -36,6 +36,8 @@ import de.srsoftware.belegscanner.Constants;
|
||||
import de.srsoftware.tools.gui.DateChooser;
|
||||
import de.srsoftware.tools.gui.SelectComboBox;
|
||||
|
||||
import static de.srsoftware.belegscanner.Application.*;
|
||||
|
||||
public class Toolbar extends JPanel {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(Toolbar.class);
|
||||
@@ -93,8 +95,8 @@ public class Toolbar extends JPanel {
|
||||
this.config = config;
|
||||
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
||||
add(datePicker());
|
||||
add(input("Kategorie",catPicker = categoryPicker(config)));
|
||||
add(input("Pfad",pathPicker = pathPicker()));
|
||||
add(input(t("Category"),catPicker = categoryPicker(config)));
|
||||
add(input(t("Path"),pathPicker = pathPicker()));
|
||||
addFormatSelector();
|
||||
add(resolutionSelector());
|
||||
add(scanButton());
|
||||
@@ -133,7 +135,7 @@ public class Toolbar extends JPanel {
|
||||
dummy.setLayout(new BorderLayout());
|
||||
dummy.setMaximumSize(new Dimension(600, 40));
|
||||
|
||||
dummy.add(new JLabel("Breite: "),BorderLayout.WEST);
|
||||
dummy.add(new JLabel(t("width")+": "),BorderLayout.WEST);
|
||||
dummy.add(width = new JTextField(209+""),BorderLayout.CENTER);
|
||||
dummy.add(new JLabel("px"),BorderLayout.EAST);
|
||||
add(dummy);
|
||||
@@ -142,7 +144,7 @@ public class Toolbar extends JPanel {
|
||||
dummy.setLayout(new BorderLayout());
|
||||
dummy.setMaximumSize(new Dimension(600, 40));
|
||||
|
||||
dummy.add(new JLabel("Höhe: "),BorderLayout.WEST);
|
||||
dummy.add(new JLabel(t("height")+": "),BorderLayout.WEST);
|
||||
dummy.add(height = new JTextField(297+""),BorderLayout.CENTER);
|
||||
dummy.add(new JLabel("px"),BorderLayout.EAST);
|
||||
add(dummy);
|
||||
@@ -260,7 +262,7 @@ public class Toolbar extends JPanel {
|
||||
|
||||
private JPanel input(String caption, JComponent component) {
|
||||
component.setMaximumSize(new Dimension(600, 40));
|
||||
component.setToolTipText("Drücken Sie Umschalt + Entf um einen Eintrag zu löschen");
|
||||
component.setToolTipText(t("Press Shift + Delete to remove an entry."));
|
||||
JPanel panel = new JPanel();
|
||||
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
|
||||
panel.add(new JLabel(caption+": "));
|
||||
@@ -274,7 +276,7 @@ public class Toolbar extends JPanel {
|
||||
JSONObject catInfo = cats.getJSONObject(catName);
|
||||
if (catInfo.has("path")) paths.add(catInfo.get("path"));
|
||||
}
|
||||
paths.add("$HOME/$JAHR/$MONAT-$TAG - $KATEGORIE");
|
||||
paths.add("$"+t("HOME")+"/$"+t("YEAR")+"/$"+t("MONTH")+"-$"+t("DAY")+" - $"+t("CATEGORY"));
|
||||
return new SelectComboBox(paths).onUpdateText(this::updatePath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user