Skip to content

Commit

Permalink
Completed german translation. Every text that is displayed to the use…
Browse files Browse the repository at this point in the history
…r should now be translatable. (fr #30)
  • Loading branch information
LMH01 committed Apr 30, 2021
1 parent 3c5e4fd commit b9bd200
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
28 changes: 14 additions & 14 deletions src/main/java/com/github/lmh01/mgt2mt/mod/LicenceMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,28 @@ public ArrayList<JMenuItem> getModMenuItems() {

@Override
public void menuActionAddMod() {
JLabel labelAddLicence = new JLabel("Name: ");
JLabel labelAddLicence = new JLabel(I18n.INSTANCE.get("commonText.name") + ":");
JTextField textFieldName = new JTextField();

JPanel panelType = new JPanel();
JLabel labelType = new JLabel("Type: ");
JLabel labelType = new JLabel(I18n.INSTANCE.get("commonText.type") + ":");
JComboBox comboBoxType = new JComboBox();
comboBoxType.setModel(new DefaultComboBoxModel<>(new String[]{"Movie", "Book", "Sport"}));
comboBoxType.setModel(new DefaultComboBoxModel<>(new String[]{I18n.INSTANCE.get("mod.licence.addMod.optionPaneMessage.movie"), I18n.INSTANCE.get("mod.licence.addMod.optionPaneMessage.book"), I18n.INSTANCE.get("mod.licence.addMod.optionPaneMessage.sport")}));
panelType.add(labelType);
panelType.add(comboBoxType);

Object[] params = {labelAddLicence, textFieldName, panelType};
while(true){
if(JOptionPane.showConfirmDialog(null, params, "Add Licence", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION){
if(JOptionPane.showConfirmDialog(null, params, I18n.INSTANCE.get("commonText.add.upperCase") + ": " + getType(), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION){
if(!textFieldName.getText().isEmpty()){
StringBuilder newLicence = new StringBuilder();
newLicence.append(textFieldName.getText()).append(" ");
String selectedType = comboBoxType.getSelectedItem().toString();
if(selectedType.equals("Movie")){
if(selectedType.equals(I18n.INSTANCE.get("mod.licence.addMod.optionPaneMessage.movie"))){
newLicence.append("[MOVIE]");
}else if(selectedType.equals("Book")){
}else if(selectedType.equals(I18n.INSTANCE.get("mod.licence.addMod.optionPaneMessage.book"))){
newLicence.append("[BOOK]");
}else if(selectedType.equals("Sport")){
}else if(selectedType.equals(I18n.INSTANCE.get("mod.licence.addMod.optionPaneMessage.sport"))){
newLicence.append("[SPORT]");
}
boolean licenceAlreadyExists = false;
Expand All @@ -139,26 +139,26 @@ public void menuActionAddMod() {
}
if(!licenceAlreadyExists){
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Add this licence:").append(System.getProperty("line.separator"))
stringBuilder.append(I18n.INSTANCE.get("mod.licence.addMod.confirm") + ":").append(System.getProperty("line.separator"))
.append(textFieldName.getText()).append(System.getProperty("line.separator"))
.append("Type: ").append(comboBoxType.getSelectedItem());
if(JOptionPane.showConfirmDialog(null, stringBuilder.toString(), "Add this licence?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
if(JOptionPane.showConfirmDialog(null, stringBuilder.toString(), I18n.INSTANCE.get("commonText.add.upperCase") + ": " + getType(), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
try {
Backup.createBackup(getFile());
ModManager.licenceMod.getEditor().addMod(newLicence.toString());
TextAreaHelper.appendText(I18n.INSTANCE.get("textArea.added") + " " + I18n.INSTANCE.get("window.main.share.export.licence") + " - " + textFieldName.getText());
JOptionPane.showMessageDialog(null, "Licence [" + textFieldName.getText() + "] has been added successfully!");
TextAreaHelper.appendText(I18n.INSTANCE.get("textArea.added") + " " + I18n.INSTANCE.get("commonText.licence.upperCase") + " - " + textFieldName.getText());
JOptionPane.showMessageDialog(null, I18n.INSTANCE.get("commonText.licence.upperCase") + ": [" + textFieldName.getText() + "] " + I18n.INSTANCE.get("commonText.successfullyAdded"), I18n.INSTANCE.get("textArea.added") + " " + getType(), JOptionPane.INFORMATION_MESSAGE);
break;
} catch (IOException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "<html>Unable to add licence:<br>Exception: " + e.getMessage(), "Unable to add licence", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "<html>" + I18n.INSTANCE.get("mod.licence.addMod.error") + ":<br>" + I18n.INSTANCE.get("commonBodies.exception") + ": " + e.getMessage(), I18n.INSTANCE.get("frame.title.error"), JOptionPane.ERROR_MESSAGE);
}
}
}else{
JOptionPane.showMessageDialog(null, "Unable to add licence: The licence does already exist!", I18n.INSTANCE.get("frame.title.error"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, I18n.INSTANCE.get("commonText.nameAlreadyInUse"), I18n.INSTANCE.get("frame.title.error"), JOptionPane.ERROR_MESSAGE);
}
}else{
JOptionPane.showMessageDialog(null, "Please enter a licence name first!", "Unable to continue", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(null, I18n.INSTANCE.get("modManager.general.enterNameFirst"), I18n.INSTANCE.get("frame.title.error"), JOptionPane.ERROR_MESSAGE);
}
}else{
break;
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/locale/de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ mod.gameplayFeature.addMod.optionPaneMessage.firstPart|Dein Gameplay Feature ist
mod.licence.addMod.optionPaneMessage.book|Buch
mod.licence.addMod.optionPaneMessage.movie|Film
mod.licence.addMod.optionPaneMessage.sport|Sport
mod.licence.addMod.confirm|Soll diese Lizenz hinzugefügt werden?
mod.licence.addMod.error|Fehler beim hinzufügen der Lizenz:
mod.engineFeature.addMod.title|Engine Feature hinzufügen?
mod.engineFeature.addMod.components.type.toolTip|Wähle aus, welchen Typs das Engine Feature sein soll
mod.gameplayFeature.addMod.title|Gameplay Feature hinzufügen?
Expand Down Expand Up @@ -680,7 +682,7 @@ textArea.uninstalling.uninstallingAllMods.genre.failed|Deinstallation des Genre
textArea.uninstalling.uninstallingAllMods.publisher.failed|Deinstallation des Publisher fehlgeschlagen:
textArea.uninstalling.uninstallingAllMods.platform.failed|Deinstallation der Platform fehlgeschlagen:
textArea.uninstalling.uninstallingAllMods.success|Spieldateien wurden zu ihrem original Zustand zurückgesetzt
textArea.uninstalling.uninstallingAllMods.noModsFound|Es müssen keine Mods entfernt werde: Keine Mods gefunden
textArea.uninstalling.uninstallingAllMods.noModsFound|Es müssen keine Mods entfernt werden: Keine Mods gefunden
textArea.deleteModManagerFiles|Lösche alle mod manager Dateien
textArea.deletingBackups|Lösche Backups
textArea.deletingSettings|Lösche Einstellungen
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/locale/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ mod.publisher.icon|Publisher Icon
mod.licence.addMod.optionPaneMessage.book|Book
mod.licence.addMod.optionPaneMessage.movie|Movie
mod.licence.addMod.optionPaneMessage.sport|Sport
mod.licence.addMod.confirm|Add this licence
mod.licence.addMod.error|Error while adding licence:
mod.engineFeature.addMod.title|Add engine feature?
mod.engineFeature.addMod.components.type.toolTip|Select what type your engine feature should be
mod.gameplayFeature.addMod.title|Add gameplay feature?
Expand Down

0 comments on commit b9bd200

Please sign in to comment.