"Germanization"

This commit is contained in:
mmk2410 2015-06-09 10:56:50 +02:00
parent 17e2599c19
commit cf65377930
6 changed files with 40 additions and 16 deletions

View file

@ -21,7 +21,7 @@
<grid id="6882f" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="6882f" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<tabbedpane title="writtenMorse"/> <tabbedpane title="writtenMorse" noi18n="true"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"/> <border type="none"/>
@ -37,7 +37,7 @@
<constraints/> <constraints/>
<properties> <properties>
<lineWrap value="true"/> <lineWrap value="true"/>
<text value="Enter your text"/> <text resource-bundle="de/marcelkapfer/c/morseconverter/text" key="inputText"/>
</properties> </properties>
</component> </component>
</children> </children>
@ -64,7 +64,7 @@
<grid id="abf8c" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="abf8c" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<tabbedpane title="Normal Morse"/> <tabbedpane title-resource-bundle="de/marcelkapfer/c/morseconverter/text" title-key="tabNormalMorse"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"/> <border type="none"/>
@ -79,7 +79,7 @@
<component id="b5dfc" class="javax.swing.JTextArea" binding="inputAreaNormalMorse"> <component id="b5dfc" class="javax.swing.JTextArea" binding="inputAreaNormalMorse">
<constraints/> <constraints/>
<properties> <properties>
<text value="Enter your text"/> <text resource-bundle="de/marcelkapfer/c/morseconverter/text" key="inputText"/>
</properties> </properties>
</component> </component>
</children> </children>
@ -102,7 +102,7 @@
<grid id="4a85e" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="4a85e" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<tabbedpane title="About"/> <tabbedpane title-resource-bundle="de/marcelkapfer/c/morseconverter/text" title-key="tabAbout"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"/> <border type="none"/>
@ -112,7 +112,7 @@
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties> <properties>
<text value="Update Dialog"/> <text resource-bundle="de/marcelkapfer/c/morseconverter/text" key="updateButton"/>
</properties> </properties>
</component> </component>
<hspacer id="f1f0d"> <hspacer id="f1f0d">
@ -134,7 +134,7 @@
<editable value="false"/> <editable value="false"/>
<enabled value="true"/> <enabled value="true"/>
<font/> <font/>
<text value="&lt;html&gt;&#10; &lt;head&gt;&#10; &#10; &lt;/head&gt;&#10; &lt;body&gt;&#10; &lt;p style=&quot;margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px&quot;&gt;&#10; &lt;b&gt;Developer&lt;/b&gt;&lt;br&gt;Marcel Kapfer&#10; &lt;/p&gt;&#10; &lt;p style=&quot;margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px&quot;&gt;&#10; &lt;b&gt;Version&lt;/b&gt;&lt;br&gt;2.0.0 dev&#10; &lt;/p&gt;&#10; &lt;/body&gt;&#10;&lt;/html&gt;&#10;"/> <text resource-bundle="de/marcelkapfer/c/morseconverter/text" key="about"/>
</properties> </properties>
<clientProperties> <clientProperties>
<JEditorPane.honorDisplayProperties class="java.lang.Boolean" value="false"/> <JEditorPane.honorDisplayProperties class="java.lang.Boolean" value="false"/>

View file

@ -35,6 +35,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.ResourceBundle;
public class Main extends JFrame { public class Main extends JFrame {
@ -42,6 +43,7 @@ public class Main extends JFrame {
public static final int currentVersion = 200; public static final int currentVersion = 200;
public int latestVersion = currentVersion; public int latestVersion = currentVersion;
public static ResourceBundle resourceBundle = ResourceBundle.getBundle("de.marcelkapfer.c.morseconverter.text");
public JTabbedPane morseConverterPane; public JTabbedPane morseConverterPane;
private JPanel panel1; private JPanel panel1;
private JTextArea inputAreaWrittenMorse; private JTextArea inputAreaWrittenMorse;
@ -73,7 +75,7 @@ public class Main extends JFrame {
//TODO To be also shown in the about view //TODO To be also shown in the about view
if (currentVersion < latestVersion){ if (currentVersion < latestVersion){
JOptionPane.showMessageDialog(null, "An Update is available!\nGo to the 'About' section for more."); JOptionPane.showMessageDialog(null, resourceBundle.getString("updateAvailable"));
} }
updateDialogButton.addActionListener(new ActionListener() { updateDialogButton.addActionListener(new ActionListener() {
@ -97,7 +99,7 @@ public class Main extends JFrame {
main.setContentPane(new Main().morseConverterPane); main.setContentPane(new Main().morseConverterPane);
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Title // Title
main.setTitle("Morse Converter"); main.setTitle(resourceBundle.getString("title"));
main.pack(); main.pack();
// Window position and Size // Window position and Size
main.setBounds(100, 100, 800, 400); main.setBounds(100, 100, 800, 400);
@ -123,7 +125,7 @@ public class Main extends JFrame {
private void instantNormalMorseConvert(){ private void instantNormalMorseConvert(){
// Gets the text from the input field // Gets the text from the input field
String input = inputAreaNormalMorse.getText(); String input = inputAreaNormalMorse.getText();
// cechs if the code is a normal Morse code // checks if the code is a normal Morse code
if(NormalMorseCodeRecognization.isCode(input)){ if(NormalMorseCodeRecognization.isCode(input)){
// converts the code into normal letters // converts the code into normal letters
outputAreaNormalMorse.setText(EncodeNormalMorseManager.getEncodedString(input)); outputAreaNormalMorse.setText(EncodeNormalMorseManager.getEncodedString(input));

View file

@ -0,0 +1,11 @@
about=<html> <head> </head> <body> <p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px"> <b>Developer</b><br>Marcel Kapfer </p> <p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px"> <b>Version</b><br>2.0.0 dev </p> </body> </html>
inputText=Enter your text
tabAbout=About
tabNormalMorse=Normal Morse
title=Morse Converter
update-error=There was an error while getting the current directory.
update-no-connection=The connection to the server was not possible.\nTry again later.
update-not-successful=Update not successful
update-successful=Update successful.\nPlease restart the software to activate the changes.
updateAvailable=An Update is available\!\nGo to the 'About' section for more.
updateButton=Check for updates

View file

@ -0,0 +1,11 @@
about=<html> <head> </head> <body> <p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px"> <b>Entwickler\:</b><br>Marcel Kapfer </p> <p style\="margin-top\: 5px; margin-right\: 5px; margin-bottom\: 5px; margin-left\: 5px"> <b>Version</b><br>2.0.0 dev </p> </body> </html>
inputText=Geben Sie einen Text ein
tabAbout=Über
tabNormalMorse=Normales Morse
title=Morse Umwandler
update-error=Es trat ein Fehler auf, beim Versuch das aktuelle Verzeichniss zu finden
update-no-connection=Eine Verbindung zum Server war nicht möglich\nVersuchen Sie es später nochmal.
update-not-successful=Update nich erfolgreich
update-successful=Update erfolgreich\nBitte starten Sie die Software neu um die Änderungen zu aktivieren
updateAvailable=Ein Update ist verfügbarr\nMehr in der "Über" Abteilung.
updateButton=Auf Updates überprüfen

View file

@ -2,9 +2,7 @@ package de.marcelkapfer.c.morseconverter.update;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.nio.channels.Channels; import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel; import java.nio.channels.ReadableByteChannel;

View file

@ -30,11 +30,13 @@ import java.io.File;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ResourceBundle;
public class UpdateDialog extends JDialog { public class UpdateDialog extends JDialog {
private JPanel contentPane; private JPanel contentPane;
private JButton buttonOK; private JButton buttonOK;
private JButton buttonCancel; private JButton buttonCancel;
private ResourceBundle resourceBundle = ResourceBundle.getBundle("de.marcelkapfer.c.morseconverter.text");
public UpdateDialog() { public UpdateDialog() {
setContentPane(contentPane); setContentPane(contentPane);
@ -76,16 +78,16 @@ public class UpdateDialog extends JDialog {
path = path.substring(0, path.lastIndexOf(File.separator)); path = path.substring(0, path.lastIndexOf(File.separator));
if(Update.isConnected("http://c2/LAB/java/morseconverter/morseconverter-1.jar")){ if(Update.isConnected("http://c2/LAB/java/morseconverter/morseconverter-1.jar")){
if(Update.update(path + File.separator, "morseconverter-1.jar")){ if(Update.update(path + File.separator, "morseconverter-1.jar")){
JOptionPane.showMessageDialog(null, "Update successful. \n Please restart the software to activate."); JOptionPane.showMessageDialog(null, resourceBundle.getString("update-successful"));
} else { } else {
JOptionPane.showMessageDialog(null, "Update not successful."); JOptionPane.showMessageDialog(null, resourceBundle.getString("update-not-successful"));
} }
} else { } else {
JOptionPane.showMessageDialog(null, "The connection to the server was not possible. \n Try again later."); JOptionPane.showMessageDialog(null, resourceBundle.getString("update-no-connection"));
} }
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
e.printStackTrace(); e.printStackTrace();
JOptionPane.showMessageDialog(null, "There was an error while getting the current directory."); JOptionPane.showMessageDialog(null, resourceBundle.getString("update-error"));
} }
dispose(); dispose();
} }