Skip to content

Commit

Permalink
Added translations for: Add company logo and some image file choosers…
Browse files Browse the repository at this point in the history
…. (fr #30)
  • Loading branch information
LMH01 committed Apr 30, 2021
1 parent e4d6432 commit cd60052
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/lmh01/mgt2mt/mod/GenreMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public boolean accept(File f) {

@Override
public String getDescription() {
return ".png files";
return I18n.INSTANCE.get("commonText.imageFile.selectionType");
}
};

Expand Down Expand Up @@ -424,7 +424,7 @@ public boolean accept(File f) {

@Override
public String getDescription() {
return ".png files";
return I18n.INSTANCE.get("commonText.imageFile.selectionType");
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/lmh01/mgt2mt/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,24 @@ public boolean accept(File f) {

@Override
public String getDescription() {
return ".png files";
return I18n.INSTANCE.get("commonText.imageFile.selectionType");
}
};

JFileChooser fileChooser = new JFileChooser(); //Create a new GUI that will use the current(windows) Look and Feel
fileChooser.setFileFilter(fileFilter);
fileChooser.setDialogTitle("Choose a genre image (.png):");
fileChooser.setDialogTitle(I18n.INSTANCE.get("commonText.imageFile.selectPngFile.fileChooser"));

int return_value = fileChooser.showOpenDialog(null);
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); //revert the Look and Feel back to the ugly Swing
if(return_value == JFileChooser.APPROVE_OPTION){
if(fileChooser.getSelectedFile().getName().contains(".png")){
if(showConfirmMessage){
JOptionPane.showMessageDialog(new Frame(), "Image file set.");
JOptionPane.showMessageDialog(new Frame(), I18n.INSTANCE.get("commonText.imageFileSet"));
}
return fileChooser.getSelectedFile().getPath();
}else{
JOptionPane.showMessageDialog(new Frame(), "Please select a .png file.");
JOptionPane.showMessageDialog(new Frame(), I18n.INSTANCE.get("commonText.imageFile.selectPngFile"));
return "error";
}
}else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static void addCompanyIcon(){
try {
Files.copy(Paths.get(imageFileSource.getPath()), Paths.get(targetImage.getPath()));
TextAreaHelper.appendText(I18n.INSTANCE.get("textArea.addCompanyIcon.success"));
JOptionPane.showMessageDialog(null, "Image has been added.", "Image added", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(null, I18n.INSTANCE.get("mod.companyIcon.added"), I18n.INSTANCE.get("mod.companyIcon.added.title"), JOptionPane.INFORMATION_MESSAGE);
} catch (IOException e) {
TextAreaHelper.appendText(I18n.INSTANCE.get("textArea.addCompanyIcon.error") + " " + e.getMessage());
JOptionPane.showMessageDialog(null, I18n.INSTANCE.get("textArea.addCompanyIcon.error") + "\n\n" + e.getMessage(), I18n.INSTANCE.get("frame.title.error"), JOptionPane.ERROR_MESSAGE);
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/locale/de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ commonText.screenshots.added|Screenhots eingestellt
commonText.imageFile.doesNotExist|<html>Die eingegebene Bilddatei existiert nicht.<br>Wähle bitte eine gültige Datei aus.
commonText.imageFile.selectPngFile|Wähle bitte eine .png Datei aus.
commonText.imageFile.selectOnlyPngFile|Wähle bitte nur .png Dateien aus.
commonText.imageFile.selectPngFile.fileChooser|Wähle ein Genre Bild aus (png.):
commonText.imageFile.selectPngFile.fileChooser|Wähle eine Bilddatei aus (png.):
commonText.imageFile.selectPngFiles.fileChooser|Wähle .png Dateien aus:
commonText.imageFile.selectionType|.png Dateien
commonText.followingImageFilesHaveBeenAdded.firstPart|<html>Die folgenden Bilddateien wurden hinzugefügt:
commonText.isThisCorrect|Ist das richtig und möchtest du weiter machen?
commonText.browse|Durchsuchen
Expand Down Expand Up @@ -383,6 +384,8 @@ mod.genre.enterDescriptionFirst|Gib bitte zu erst eine Beschreibung für das Gen
mod.genre.translation.donNotShowInfoAgain|Diese Information nicht noch einmal anzeigen
mod.genre.translation.information|<html>Hinweis:<br>Die Übersetzung, die in das "Haupt"-Textfeld geschrieben wird, wird für die Englische Übersetzung benutzt.<br><br>Fortsetzen?
mod.genre.sameSelection.text|<html>Fortsetzung nicht möglich: Es ist nicht zulässig, dasselbe Feature in beiden Listen auszuwählen.<br>Bitte deaktiviere das Feature in einer Liste.
mod.companyIcon.added|Bild wurde hinzugefügt.
mod.companyIcon.added.title|Bild hinzugefügt.

sharer.exportFailed.generalError.firstPart|Export nicht möglich:
sharer.exportFailed.generalError.secondPart|Der folgende Fehler ist aufgetreten:
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/locale/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ commonText.imageFileSet|Image file set
commonText.screenshots.added|Screenshots set
commonText.imageFile.doesNotExist|<html>The entered image file does not exist.<br>Please select a valid file.
commonText.imageFile.selectPngFile|Please select a .png file.
commonText.imageFile.selectPngFiles.fileChooser|Please select .png files:
commonText.imageFile.selectOnlyPngFile|Please select only .png files.
commonText.imageFile.selectPngFile.fileChooser|Choose a genre image (.png):
commonText.imageFile.selectPngFile.fileChooser|Choose a image file (.png):
commonText.imageFile.selectPngFiles.fileChooser|Please select .png files:
commonText.imageFile.selectionType|.png files
commonText.followingImageFilesHaveBeenAdded.firstPart|<html>The following image files have been added:
commonText.isThisCorrect|Is this correct and do you want to continue?
commonText.browse|Browse
Expand Down Expand Up @@ -383,6 +384,8 @@ mod.genre.enterDescriptionFirst|Please enter a genre description first!
mod.genre.translation.donNotShowInfoAgain|Don't show this information again
mod.genre.translation.information|<html>Note:<br>The translation that you have entered in the "main"text field<br>will be used as the english translation.<br><br>Continue?
mod.genre.sameSelection.text|<html>Unable to continue: It is not allowed to select the same feature in booth lists.<br>Please deselect the feature from one list.
mod.companyIcon.added|Image has been added.
mod.companyIcon.added.title|Image added.

sharer.exportFailed.generalError.firstPart|Unable to export:
sharer.exportFailed.generalError.secondPart|The following error occurred:
Expand Down

0 comments on commit cd60052

Please sign in to comment.