From d1203109afd71da54b95215e9fd550563b41b423 Mon Sep 17 00:00:00 2001
From: tobias <thinkdifferent055@gmail.com>
Date: Thu, 3 Dec 2020 20:49:34 +0100
Subject: [PATCH] Add running java version to about dialog, localize about
 dialog

---
 .../viewcontroller/dialog/AboutDialog.java    | 12 +++++++---
 .../src/main/resources/lang/ui_de.properties  | 12 +++++++++-
 .../src/main/resources/view/dialog/About.fxml | 23 ++++++++++++-------
 3 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/AboutDialog.java b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/AboutDialog.java
index 7c475927..4ae03e04 100644
--- a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/AboutDialog.java
+++ b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/AboutDialog.java
@@ -28,7 +28,6 @@ import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 
-// TODO Extract into lang file
 public class AboutDialog extends NVC {
 
 	@FXML
@@ -40,6 +39,9 @@ public class AboutDialog extends NVC {
 	@FXML
 	private Label versionLabel;
 
+	@FXML
+	private Label platformLabel;
+
 	@FXML
 	private Label authorLabel;
 
@@ -52,7 +54,7 @@ public class AboutDialog extends NVC {
 	@FXML
 	private Label graphicsLabel;
 
-	private Window owner;
+	private final Window owner;
 
 	public AboutDialog(Window owner) {
 		this.owner = owner;
@@ -68,7 +70,7 @@ public class AboutDialog extends NVC {
 		AnchorPane.setLeftAnchor(icon, 14.0);
 		AnchorPane.setTopAnchor(icon, 14.0);
 
-		icon.setOnMouseClicked((e) -> getStageContainer().ifPresent(NVCStage::close));
+		icon.setOnMouseClicked(e -> getStageContainer().ifPresent(NVCStage::close));
 
 		ApplicationInfo info = ApplicationUtils.getApplication().getInfo();
 		versionLabel.setText(info.getVersion());
@@ -76,6 +78,10 @@ public class AboutDialog extends NVC {
 		graphicsLabel.setText(Localization.getString(Strings.UI_DIALOG_ABOUT_GRAPHICS));
 		libsLabel.setText(Localization.getString(Strings.UI_DIALOG_ABOUT_LIBRARIES));
 
+		platformLabel.setText(String.format("%s (%s) + %s (%s)", System.getProperty("java.version"),
+				System.getProperty("java.vendor"), System.getProperty("javafx.version"),
+				System.getProperty("javafx.runtime.version")));
+
 		Hyperlink websiteLink = new Hyperlink(Localization.getString(Strings.UI_DIALOG_ABOUT_WEBSITE));
 		websiteLink.setPadding(Insets.EMPTY);
 		websiteLink.setFocusTraversable(false);
diff --git a/PlayWall/src/main/resources/lang/ui_de.properties b/PlayWall/src/main/resources/lang/ui_de.properties
index 53686c94..4d959731 100755
--- a/PlayWall/src/main/resources/lang/ui_de.properties
+++ b/PlayWall/src/main/resources/lang/ui_de.properties
@@ -233,4 +233,14 @@ PathMatchDialog.Table.Column.FileName=Dateiname
 PathMatchDialog.Table.Column.LocalPath=Lokaler Pfad
 PathMatchDialog.Table.Column.Action=Aktionen
 PathMatchDialog.Button.Cancel=Abbrechen
-PathMatchDialog.Button.Finish=\u00DCbernehmen
\ No newline at end of file
+PathMatchDialog.Button.Finish=\u00DCbernehmen
+
+about.label.headline=\u00DCber PLayWall
+about.label.version=Version:
+about.label.author=Autor:
+about.label.graphics=Grafiken:
+about.label.platform=Plattform:
+about.label.website=Webseite:
+about.label.code=Code:
+about.label.libraries=Bibliotheken:
+about.label.thanksgiving=Besonderen Dank an die treuen Betatester Stefan und Robert.
\ No newline at end of file
diff --git a/PlayWall/src/main/resources/view/dialog/About.fxml b/PlayWall/src/main/resources/view/dialog/About.fxml
index 45bfe74d..952fc777 100644
--- a/PlayWall/src/main/resources/view/dialog/About.fxml
+++ b/PlayWall/src/main/resources/view/dialog/About.fxml
@@ -19,49 +19,56 @@
                 </ImageView>
                 <VBox alignment="CENTER_LEFT" spacing="7.0">
                     <children>
-                        <Label styleClass="about-headline" text="Über PlayWall">
+                        <Label styleClass="about-headline" text="%about.label.headline">
                             <VBox.margin>
                                 <Insets bottom="14.0"/>
                             </VBox.margin>
                         </Label>
                         <HBox spacing="14.0">
                             <children>
-                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="Version:" textAlignment="RIGHT"/>
+                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="%about.label.version" textAlignment="RIGHT"/>
                                 <Label fx:id="versionLabel" text="1.0.0"/>
                             </children>
                         </HBox>
                         <HBox spacing="14.0">
                             <children>
-                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="Autor:" textAlignment="RIGHT"/>
+                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="%about.label.author" textAlignment="RIGHT"/>
                                 <Label fx:id="authorLabel" text="Tobias Ullerich"/>
                             </children>
                         </HBox>
                         <HBox spacing="14.0">
                             <children>
-                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="Grafiken:"
+                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="%about.label.graphics"
                                        textAlignment="RIGHT"/>
                                 <Label fx:id="graphicsLabel" text="Robert Goldmann"/>
                             </children>
                         </HBox>
+                        <HBox spacing="14.0">
+                            <children>
+                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="%about.label.platform" textAlignment="RIGHT"/>
+                                <Label fx:id="platformLabel" text="controlsfx" wrapText="true"/>
+                            </children>
+                        </HBox>
+
                         <HBox fx:id="websiteContainer" spacing="14.0">
                             <children>
-                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="Webseite" textAlignment="RIGHT"/>
+                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="%about.label.website" textAlignment="RIGHT"/>
                             </children>
                         </HBox>
                         <HBox fx:id="codeContainer" spacing="14.0">
                             <children>
-                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="Code:" textAlignment="RIGHT"/>
+                                <Label alignment="CENTER_RIGHT" prefWidth="75.0" text="%about.label.code" textAlignment="RIGHT"/>
                             </children>
                         </HBox>
                         <HBox spacing="14.0">
                             <children>
-                                <Label alignment="CENTER_RIGHT" minWidth="75.0" prefWidth="75.0" text="Libraries:"
+                                <Label alignment="CENTER_RIGHT" minWidth="75.0" prefWidth="75.0" text="%about.label.libraries"
                                        textAlignment="RIGHT"/>
                                 <Label fx:id="libsLabel" text="controlsfx" wrapText="true"/>
                             </children>
                         </HBox>
                         <Label maxWidth="1.7976931348623157E308"
-                               text="Besonderen Dank an die treuen Betatester Stefan und Robert." wrapText="true">
+                               text="%about.label.thanksgiving" wrapText="true">
                             <VBox.margin>
                                 <Insets left="89.0"/>
                             </VBox.margin>
-- 
GitLab