From c3273aa1bb51be7a579c53e2d36b3da5d8efd4fc Mon Sep 17 00:00:00 2001 From: Aizistral Date: Tue, 29 Oct 2024 02:03:40 +0100 Subject: [PATCH] Use localized algorithm names in encryption tooltip --- .../aizistral/nochatreports/common/encryption/Encryption.java | 4 ++++ .../common/mixins/client/MixinChatComponent.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java index 259d89df..696d2397 100644 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java +++ b/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java @@ -38,6 +38,10 @@ public String getName() { return this.name; } + public String getNameLocalizationKey() { + return "algorithm.nochatreports." + this.id + ".name"; + } + public abstract String getRandomKey(); public abstract String getDefaultKey(); diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java index 42ed761c..74031fdd 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java @@ -64,7 +64,7 @@ private GuiMessage modifyGUIMessage(GuiMessage msg) { if (NCRConfig.getEncryption().showEncryptionIndicators()) { Component tooltip = Component.empty().append(Component.translatable("tag.nochatreports.encrypted", - Component.literal(NCRConfig.getEncryption().getAlgorithm().getName()) + Component.translatable(NCRConfig.getEncryption().getAlgorithm().getNameLocalizationKey()) .withStyle(ChatFormatting.BOLD))).append(CommonComponents.NEW_LINE).append( Component.translatable("tag.nochatreports.encrypted_original", this.lastMessageOriginal));