From dcbc28c93160ac955ecdd1d547eb2d2cee151863 Mon Sep 17 00:00:00 2001 From: RoinujNosde Date: Sun, 30 Jan 2022 00:00:19 -0300 Subject: [PATCH] Fixes /help messages not localized #296 --- .../java/co/aikar/commands/BukkitRootCommand.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java b/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java index d9d48643..68c74c92 100644 --- a/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java +++ b/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java @@ -51,15 +51,18 @@ public class BukkitRootCommand extends Command implements RootCommand, PluginIde @Override public String getDescription() { RegisteredCommand command = getDefaultRegisteredCommand(); + String description = null; if (command != null && !command.getHelpText().isEmpty()) { - return command.getHelpText(); + description = command.getHelpText(); + } else if (command != null && command.scope.description != null) { + description = command.scope.description; + } else if (defCommand.description != null) { + description = defCommand.description; } - if (command != null && command.scope.description != null) { - return command.scope.description; - } - if (defCommand.description != null) { - return defCommand.description; + + if (description != null) { + return manager.getLocales().replaceI18NStrings(description); } return super.getDescription(); }