diff --git a/src/main/java/net/raphimc/viaproxy/ui/elements/LinkLabel.java b/src/main/java/net/raphimc/viaproxy/ui/elements/LinkLabel.java
new file mode 100644
index 0000000..8630767
--- /dev/null
+++ b/src/main/java/net/raphimc/viaproxy/ui/elements/LinkLabel.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy
+ * Copyright (C) 2021-2024 RK_01/RaphiMC and contributors
+ *
+ * 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 .
+ */
+package net.raphimc.viaproxy.ui.elements;
+
+import net.raphimc.viaproxy.ui.ViaProxyWindow;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+public class LinkLabel extends JLabel {
+
+ public LinkLabel(final String text, final String url) {
+ super("" + text + "");
+ this.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ ViaProxyWindow.openURL(url);
+ }
+ });
+ this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ }
+
+}
diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java
index 188a78e..0689df4 100644
--- a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java
+++ b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java
@@ -30,6 +30,7 @@ import net.raphimc.viaproxy.saves.impl.accounts.ClassicAccount;
import net.raphimc.viaproxy.ui.I18n;
import net.raphimc.viaproxy.ui.UITab;
import net.raphimc.viaproxy.ui.ViaProxyWindow;
+import net.raphimc.viaproxy.ui.elements.LinkLabel;
import net.raphimc.viaproxy.ui.events.UICloseEvent;
import net.raphimc.viaproxy.util.AddressUtil;
import net.raphimc.viaproxy.util.logging.Logger;
@@ -38,8 +39,6 @@ import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
@@ -77,14 +76,7 @@ public class GeneralTab extends UITab {
JPanel header = new JPanel();
header.setLayout(new GridBagLayout());
- JLabel discord = new JLabel("Discord");
- discord.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseReleased(MouseEvent e) {
- ViaProxyWindow.openURL("https://discord.gg/viaversion");
- }
- });
- discord.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ LinkLabel discord = new LinkLabel("Discord", "https://discord.gg/viaversion");
GBC.create(header).grid(0, 0).width(0).insets(BORDER_PADDING, BORDER_PADDING, 0, 0).anchor(GBC.NORTHWEST).add(discord);
JLabel title = new JLabel("ViaProxy");
diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java
index 258a9c3..4701536 100644
--- a/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java
+++ b/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java
@@ -21,12 +21,14 @@ import net.lenni0451.commons.swing.GBC;
import net.raphimc.viaproxy.ui.I18n;
import net.raphimc.viaproxy.ui.UITab;
import net.raphimc.viaproxy.ui.ViaProxyWindow;
+import net.raphimc.viaproxy.ui.elements.LinkLabel;
import net.raphimc.viaproxy.util.JarUtil;
import net.raphimc.viaproxy.util.logging.Logger;
import javax.swing.*;
import java.awt.*;
+import static net.raphimc.viaproxy.ui.ViaProxyWindow.BODY_BLOCK_PADDING;
import static net.raphimc.viaproxy.ui.ViaProxyWindow.BORDER_PADDING;
public class UISettingsTab extends UITab {
@@ -72,6 +74,8 @@ public class UISettingsTab extends UITab {
});
GBC.create(body).grid(0, gridy++).weightx(1).insets(0, BORDER_PADDING, 0, BORDER_PADDING).fill(GBC.HORIZONTAL).add(language);
}
+ GBC.create(body).grid(0, gridy++).weightx(1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, 0, BORDER_PADDING).fill(GBC.HORIZONTAL).add(new JLabel("" + I18n.get("tab.ui_settings.crowdin.info") + ""));
+ GBC.create(body).grid(0, gridy++).weightx(1).insets(0, BORDER_PADDING, 0, BORDER_PADDING).fill(GBC.HORIZONTAL).add(new LinkLabel(I18n.get("tab.ui_settings.crowdin.link"), "https://crowdin.com/project/viaproxy"));
contentPane.setLayout(new BorderLayout());
contentPane.add(body, BorderLayout.NORTH);
diff --git a/src/main/java/net/raphimc/viaproxy/ui/popups/AddAccountPopup.java b/src/main/java/net/raphimc/viaproxy/ui/popups/AddAccountPopup.java
index 7eba04a..7177bd0 100644
--- a/src/main/java/net/raphimc/viaproxy/ui/popups/AddAccountPopup.java
+++ b/src/main/java/net/raphimc/viaproxy/ui/popups/AddAccountPopup.java
@@ -21,11 +21,10 @@ import net.lenni0451.commons.swing.GBC;
import net.raphimc.minecraftauth.step.msa.StepMsaDeviceCode;
import net.raphimc.viaproxy.ui.I18n;
import net.raphimc.viaproxy.ui.ViaProxyWindow;
+import net.raphimc.viaproxy.ui.elements.LinkLabel;
import javax.swing.*;
import java.awt.*;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.function.Consumer;
@@ -72,14 +71,7 @@ public class AddAccountPopup extends JDialog {
JLabel browserLabel = new JLabel("
" + I18n.get("popup.login_account.instructions.browser") + "
");
GBC.create(contentPane).grid(0, 0).weightx(1).insets(BORDER_PADDING, BORDER_PADDING, 0, BORDER_PADDING).fill(GBC.HORIZONTAL).add(browserLabel);
- JLabel urlLabel = new JLabel("" + this.deviceCode.getDirectVerificationUri() + "");
- urlLabel.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseReleased(MouseEvent e) {
- ViaProxyWindow.openURL(AddAccountPopup.this.deviceCode.getDirectVerificationUri());
- }
- });
- GBC.create(contentPane).grid(0, 1).weightx(1).insets(0, BORDER_PADDING, 0, BORDER_PADDING).fill(GBC.HORIZONTAL).add(urlLabel);
+ GBC.create(contentPane).grid(0, 1).weightx(1).insets(0, BORDER_PADDING, 0, BORDER_PADDING).fill(GBC.HORIZONTAL).add(new LinkLabel(this.deviceCode.getDirectVerificationUri(), AddAccountPopup.this.deviceCode.getDirectVerificationUri()));
JLabel closeInfo = new JLabel("" + I18n.get("popup.login_account.instructions.close") + "
");
GBC.create(contentPane).grid(0, 2).weightx(1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING).fill(GBC.HORIZONTAL).add(closeInfo);
diff --git a/src/main/resources/assets/viaproxy/language/de_DE.properties b/src/main/resources/assets/viaproxy/language/de_DE.properties
index 904b477..fdda207 100644
--- a/src/main/resources/assets/viaproxy/language/de_DE.properties
+++ b/src/main/resources/assets/viaproxy/language/de_DE.properties
@@ -95,3 +95,5 @@ popup.download.title=Lade herunter...
popup.update.info=Du verwendest eine alte Version von ViaProxy!\nAktuelle Version: %s\nNeueste Version: %s
popup.update.question=Möchtest du aktualisieren?
popup.update.success=Die neueste Version wurde heruntergeladen. ViaProxy startet jetzt neu!
+tab.ui_settings.crowdin.info=Fehlt deine Sprache oder ist sie unvollständig? Hilf uns ViaProxy auf Crowdin zu übersetzen!
+tab.ui_settings.crowdin.link=Klick hier um Crowdin zu öffnen
diff --git a/src/main/resources/assets/viaproxy/language/en_US.properties b/src/main/resources/assets/viaproxy/language/en_US.properties
index 128ff3d..79bb168 100644
--- a/src/main/resources/assets/viaproxy/language/en_US.properties
+++ b/src/main/resources/assets/viaproxy/language/en_US.properties
@@ -95,3 +95,5 @@ popup.download.title=Downloading...
popup.update.info=You are running an outdated version of ViaProxy!\nCurrent version: %s\nLatest version: %s
popup.update.question=Do you want to update?
popup.update.success=Downloaded the latest version of ViaProxy. ViaProxy will now restart!
+tab.ui_settings.crowdin.info=Is your language missing or incomplete? Help us to translate ViaProxy on Crowdin!
+tab.ui_settings.crowdin.link=Click here to go to Crowdin