From 312c06a8e042c780df1aacc942b4f042a3634e5b Mon Sep 17 00:00:00 2001 From: NetheriteMiner <88792142+NetheriteMiner@users.noreply.github.com> Date: Sat, 2 Sep 2023 06:10:25 -0400 Subject: Fix translator missing a character at the end (#425) --- src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt index f39905876..4b0c24ccf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt @@ -34,8 +34,6 @@ class Translator { if (e.type != 0.toByte()) return // If this is not a player-sent message, return val chatComponent = e.message - // If you want to help me debug, experience the bug while this line is uncommented (spams logs) -// consoleLog(chatComponent.toString()) val message = chatComponent.unformattedText if (!messageContentRegex.matches(message.removeColor())) return @@ -180,7 +178,7 @@ class Translator { val sentenceWithoutQuotes = sentence.substring(1, sentence.length - 1) messageToSend = "$messageToSend$sentenceWithoutQuotes" } // The first translated sentence only has 1 extra char at the end, but sentences after it need 1 at the front and 1 at the end removed in the substring - messageToSend = messageToSend.substring(1, messageToSend.length - 1) + messageToSend = messageToSend.substring(1, messageToSend.length) return URLDecoder.decode(messageToSend, "UTF-8").replace("\\", "") } @@ -210,7 +208,7 @@ class Translator { } val translation = getTranslationFromEnglish(message, language) - LorenzUtils.chat("§6[SkyHanni] §eCopied translation to clipboard: $translation") + LorenzUtils.chat("§e[SkyHanni] Copied translation to clipboard: $translation") OSUtils.copyToClipboard(translation) } } -- cgit