aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorNetheriteMiner <88792142+NetheriteMiner@users.noreply.github.com>2023-09-02 06:10:25 -0400
committerGitHub <noreply@github.com>2023-09-02 12:10:25 +0200
commit312c06a8e042c780df1aacc942b4f042a3634e5b (patch)
tree4017f4da9815c33404a2ef0abf53793d647d3275 /src/main/java
parentb41e3fe173b49517cbc4eadae172106d947f3e3a (diff)
downloadskyhanni-312c06a8e042c780df1aacc942b4f042a3634e5b.tar.gz
skyhanni-312c06a8e042c780df1aacc942b4f042a3634e5b.tar.bz2
skyhanni-312c06a8e042c780df1aacc942b4f042a3634e5b.zip
Fix translator missing a character at the end (#425)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt6
1 files changed, 2 insertions, 4 deletions
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)
}
}