#293 Translatable help - show translated description of child commands
- Show translated command descriptions when available - Fix bug where localized command is registered on the parent each time Thanks to @Maxetto
This commit is contained in:
@@ -67,6 +67,10 @@ public class HelpMessagesService implements Reloadable {
|
||||
return localCommand;
|
||||
}
|
||||
|
||||
public String getDescription(CommandDescription command) {
|
||||
return getText(getCommandPath(command) + DESCRIPTION_SUFFIX, command::getDescription);
|
||||
}
|
||||
|
||||
public String getMessage(HelpMessage message) {
|
||||
return messageFileHandler.getMessage(message.getKey());
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ public class HelpProvider implements Reloadable {
|
||||
String parentCommandPath = String.join(" ", parentLabels);
|
||||
for (CommandDescription child : command.getChildren()) {
|
||||
lines.add(" /" + parentCommandPath + " " + child.getLabels().get(0)
|
||||
+ ChatColor.GRAY + ChatColor.ITALIC + ": " + child.getDescription());
|
||||
+ ChatColor.GRAY + ChatColor.ITALIC + ": " + helpMessagesService.getDescription(child));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user