From f88f15b1bfa8caaa4a9ed8068d34399fa9329ab8 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 23 Jul 2024 10:56:42 +0200 Subject: [PATCH] Make ChatTranslator setting descriptions translatable --- .../wurstclient/hacks/ChatTranslatorHack.java | 28 ++++--------------- .../FilterOwnMessagesSetting.java | 5 +--- .../assets/wurst/translations/de_de.json | 5 ++++ .../assets/wurst/translations/en_us.json | 5 ++++ 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java b/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java index cb9d0ac01c..2e80bc4e1b 100644 --- a/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java @@ -33,38 +33,22 @@ public final class ChatTranslatorHack extends Hack private final LanguageSetting playerLanguage = LanguageSetting.withoutAutoDetect("Your language", - "The main language that you can use and understand.\n\n" - + "Your received messages will always be translated into this" - + " language (if enabled).\n\n" - + "When \"Detect sent language\" is turned off, all" - + " sent messages are assumed to be in this language.", + "description.wurst.setting.chattranslator.your_language", Language.ENGLISH); private final LanguageSetting otherLanguage = LanguageSetting.withoutAutoDetect("Other language", - "The main language used by other players on the server.\n\n" - + "Your sent messages will always be translated into this" - + " language (if enabled).\n\n" - + "When \"Detect received language\" is turned off, all" - + " received messages are assumed to be in this language.", + "description.wurst.setting.chattranslator.other_language", Language.CHINESE_SIMPLIFIED); private final CheckboxSetting autoDetectReceived = new CheckboxSetting("Detect received language", - "Automatically detect the language of received messages.\n\n" - + "Useful if other players are using a mix of different" - + " languages.\n\n" - + "If everyone is using the same language, turning this off" - + " can improve accuracy.", + "description.wurst.setting.chattranslator.detect_received_language", true); - private final CheckboxSetting autoDetectSent = - new CheckboxSetting("Detect sent language", - "Automatically detect the language of sent messages.\n\n" - + "Useful if you're using a mix of different languages.\n\n" - + "If you're always using the same language, turning this off" - + " can improve accuracy.", - true); + private final CheckboxSetting autoDetectSent = new CheckboxSetting( + "Detect sent language", + "description.wurst.setting.chattranslator.detect_sent_language", true); private final FilterOwnMessagesSetting filterOwnMessages = new FilterOwnMessagesSetting(); diff --git a/src/main/java/net/wurstclient/hacks/chattranslator/FilterOwnMessagesSetting.java b/src/main/java/net/wurstclient/hacks/chattranslator/FilterOwnMessagesSetting.java index e9cb4789d2..7cbc3d5367 100644 --- a/src/main/java/net/wurstclient/hacks/chattranslator/FilterOwnMessagesSetting.java +++ b/src/main/java/net/wurstclient/hacks/chattranslator/FilterOwnMessagesSetting.java @@ -20,10 +20,7 @@ public class FilterOwnMessagesSetting extends CheckboxSetting public FilterOwnMessagesSetting() { super("Filter own messages", - "Won't translate messages that appear to be sent by you.\n\n" - + "It tries to detect your messages based on common chat formats" - + " like \"\", \"[name]\", or \"name:\". This might not" - + " work correctly on some servers.", + "description.wurst.setting.chattranslator.filter_own_messages", true); } diff --git a/src/main/resources/assets/wurst/translations/de_de.json b/src/main/resources/assets/wurst/translations/de_de.json index 203a4eea47..0ffc549aac 100644 --- a/src/main/resources/assets/wurst/translations/de_de.json +++ b/src/main/resources/assets/wurst/translations/de_de.json @@ -55,6 +55,11 @@ "description.wurst.hack.cameranoclip": "Ermöglicht der Kamera in der 3rd-Person-Ansicht, durch Wände zu gehen.", "description.wurst.hack.cavefinder": "Markiert Höhlen in der ausgewählten Farbe, sodass du sie leichter finden kannst.", "description.wurst.hack.chattranslator": "Übersetzt Chat-Nachrichten mit dem Google-Übersetzer.", + "description.wurst.setting.chattranslator.your_language": "Die Sprache, die du am besten verstehen kannst.\n\nDeine empfangenen Nachrichten werden immer in diese Sprache übersetzt (falls aktiviert).\n\nWenn \"Detect sent language\" ausgeschaltet ist, geht der Übersetzer davon aus, dass alle von dir gesendeten Nachrichten in dieser Sprache sind.", + "description.wurst.setting.chattranslator.other_language": "Die Sprache, die von anderen Spielern auf dem Server am meisten benutzt wird.\n\nDeine gesendeten Nachrichten werden immer in diese Sprache übersetzt (falls aktiviert).\n\nWenn \"Detect received language\" ausgeschaltet ist, geht der Übersetzer davon aus, dass alle empfangenen Nachrichten in dieser Sprache sind.", + "description.wurst.setting.chattranslator.detect_received_language": "Erkennt automatisch die Sprache von empfangenen Nachrichten.\n\nNützlich, wenn andere Spieler eine Mischung verschiedener Sprachen benutzen.\n\nWenn alle die gleiche Sprache benutzen, kannst du diese Einstellung ausschalten, um die Genauigkeit der Übersetzungen zu verbessern.", + "description.wurst.setting.chattranslator.detect_sent_language": "Erkennt automatisch die Sprache von gesendeten Nachrichten.\n\nNützlich, wenn du eine Mischung verschiedener Sprachen benutzt.\n\nWenn du immer die gleiche Sprache benutzt, kannst du diese Einstellung ausschalten, um die Genauigkeit der Übersetzungen zu verbessern.", + "description.wurst.setting.chattranslator.filter_own_messages": "Übersetzt keine empfangenen Nachrichten, die so aussehen, als ob sie von dir selbst gesendet wurden.\n\nChatTranslator versucht, deine eigenen Nachrichten anhand gängiger Chat-Formate wie \"\", \"[Name]\" oder \"Name:\" zu erkennen. Auf manchen Servern funktioniert das eventuell nicht richtig.", "description.wurst.hack.chestesp": "Markiert Kisten in deiner Umgebung.", "description.wurst.hack.clickaura": "Greift bei jedem Mausklick automatisch den nächsten Mob oder Spieler an.\n\n§c§lWARNUNG:§r ClickAuras sind generell auffälliger als Killauras und für Plugins leichter zu erkennen. Es ist empfohlen, statt ClickAura Killaura oder TriggerBot zu benutzen.", "description.wurst.hack.clickgui": "Fenster-basierte ClickGUI.", diff --git a/src/main/resources/assets/wurst/translations/en_us.json b/src/main/resources/assets/wurst/translations/en_us.json index 589c1fe257..04f6f3f836 100644 --- a/src/main/resources/assets/wurst/translations/en_us.json +++ b/src/main/resources/assets/wurst/translations/en_us.json @@ -74,6 +74,11 @@ "description.wurst.hack.cameranoclip": "Allows the camera in 3rd person to go through walls.", "description.wurst.hack.cavefinder": "Helps you to find caves by highlighting them in the selected color.", "description.wurst.hack.chattranslator": "Translates chat messages using Google Translate.", + "description.wurst.setting.chattranslator.your_language": "The main language that you can use and understand.\n\nYour received messages will always be translated into this language (if enabled).\n\nWhen \"Detect sent language\" is turned off, all sent messages are assumed to be in this language.", + "description.wurst.setting.chattranslator.other_language": "The main language used by other players on the server.\n\nYour sent messages will always be translated into this language (if enabled).\n\nWhen \"Detect received language\" is turned off, all received messages are assumed to be in this language.", + "description.wurst.setting.chattranslator.detect_received_language": "Automatically detect the language of received messages.\n\nUseful if other players are using a mix of different languages.\n\nIf everyone is using the same language, turning this off can improve accuracy.", + "description.wurst.setting.chattranslator.detect_sent_language": "Automatically detect the language of sent messages.\n\nUseful if you're using a mix of different languages.\n\nIf you're always using the same language, turning this off can improve accuracy.", + "description.wurst.setting.chattranslator.filter_own_messages": "Won't translate messages that appear to be sent by you.\n\nIt tries to detect your messages based on common chat formats like \"\", \"[name]\", or \"name:\". This might not work correctly on some servers.", "description.wurst.hack.chestesp": "Highlights nearby chests.", "description.wurst.hack.clickaura": "Automatically attacks the closest valid entity whenever you click.\n\n§c§lWARNING:§r ClickAuras generally look more suspicious than Killauras and are easier for plugins to detect. It is recommended to use Killaura or TriggerBot instead.", "description.wurst.hack.clickgui": "Window-based ClickGUI.",