diff --git a/imperium-mindustry/src/main/kotlin/com/xpdustry/imperium/mindustry/chat/ChatTranslatorListener.kt b/imperium-mindustry/src/main/kotlin/com/xpdustry/imperium/mindustry/chat/ChatTranslatorListener.kt index 7711822f..12b460a8 100644 --- a/imperium-mindustry/src/main/kotlin/com/xpdustry/imperium/mindustry/chat/ChatTranslatorListener.kt +++ b/imperium-mindustry/src/main/kotlin/com/xpdustry/imperium/mindustry/chat/ChatTranslatorListener.kt @@ -32,9 +32,9 @@ import kotlinx.coroutines.withTimeoutOrNull import mindustry.game.EventType.PlayerJoin class ChatTranslatorListener(instances: InstanceManager) : ImperiumApplication.Listener { - private val translator: Translator = instances.get() - private val pipeline: ChatMessagePipeline = instances.get() private val config = instances.get() + private val translator = instances.get() + private val pipeline = instances.get() override fun onImperiumInit() { pipeline.register("translator", Priority.LOW) { context -> @@ -68,7 +68,9 @@ class ChatTranslatorListener(instances: InstanceManager) : ImperiumApplication.L sourceLocale, targetLocale) is TranslatorResult.Success -> { - return@register if (rawMessage == result.text) rawMessage + return@register if (rawMessage.lowercase(sourceLocale) == + result.text.lowercase(targetLocale)) + rawMessage else "${context.message} [lightgray](${result.text})" } }