Skip to content

Commit

Permalink
Issue #22: Add l10n to application
Browse files Browse the repository at this point in the history
* New keys.
  • Loading branch information
ottlinger committed Jan 23, 2016
1 parent 32de15c commit 87976a5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/main/java/de/aikiit/spamprotector/GUI.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/**
SpamSchutz - simple way to protect your mail adresses from naiive spammers
Copyright (C) 2011, Aiki IT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
* SpamSchutz - simple way to protect your mail adresses from naiive spammers
* Copyright (C) 2011, Aiki IT
* <p/>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p/>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p/>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.aikiit.spamprotector;

Expand All @@ -23,6 +23,8 @@
import java.awt.*;
import java.util.Calendar;

import static de.aikiit.spamprotector.util.LocalizationHelper.getBundleString;

/**
* This class contains the main UI of this application (both input windows
* and all command buttons).
Expand Down Expand Up @@ -61,8 +63,8 @@ private void init(final boolean isApplet) {

// command help
final JPanel buttonArea = new JPanel();
JButton help = new JButton("Hilfe");
help.setMnemonic('H');
JButton help = new JButton(getBundleString("spamschutz.ui.help"));
help.setMnemonic(getBundleString("spamschutz.ui.help.mnemonic").charAt(0));
help.addActionListener(e -> JOptionPane.showMessageDialog(null, "Einfach ins Eingabefeld "
+ "HTML-Code einfügen!\nDann konvertieren "
+ "und schon sind weniger SpamAttacken "
Expand Down Expand Up @@ -91,8 +93,8 @@ private void init(final boolean isApplet) {
revert.setMnemonic('v');
revert.addActionListener(e -> input.setText(SpamProtector.toPlain(output.getText())));

final JButton reset = new JButton("Reset");
reset.setMnemonic('R');
final JButton reset = new JButton(getBundleString("spamschutz.ui.reset"));
reset.setMnemonic(getBundleString("spamschutz.ui.reset.mnemonic").charAt(0));
reset.addActionListener(e -> {
input.setText("");
output.setText("");
Expand Down Expand Up @@ -124,8 +126,8 @@ private void init(final boolean isApplet) {

// if started standalone we do need a quit-button
if (!isApplet) {
final JButton end = new JButton("Ende");
end.setMnemonic('E');
final JButton end = new JButton(getBundleString("spamschutz.ui.end"));
end.setMnemonic(getBundleString("spamschutz.ui.end.mnemonic").charAt(0));
end.addActionListener(e -> System.exit(0));
buttonArea.add(end);
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/spamprotector.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ spamschutz.test.param={0} und dann folgt noch die {1}
# AntiSpamApplication.java
spamschutz.main.title=SpamProtector - der einfachste Schutz gegen Spider-Spam und RegEx-Mailadressenscanner

# GUI.java
spamschutz.ui.end=Ende
spamschutz.ui.end.mnemonic=E
spamschutz.ui.reset=Reset
spamschutz.ui.reset.mnemonic=R
spamschutz.ui.help=Hilfe
spamschutz.ui.help.mnemonic=H

# ProgressBar.java
fotorenamer.ui.progress=Fortschritt
fotorenamer.ui.progress.title=Dateien werden umbenannt...
Expand Down

0 comments on commit 87976a5

Please sign in to comment.