Fixed default help not sending description reference if no translation was found

This commit is contained in:
Florian CUNY 2018-08-11 14:07:26 +02:00
parent 1c2e553e9f
commit d73539f755

View File

@ -31,7 +31,7 @@ public class DefaultHelpCommand extends CompositeCommand {
@Override @Override
public void setup() { public void setup() {
// Set the usage to what the parent's command is // Set the usage to what the parent's command is
setParameters(parent.getParameters()); setParametersHelp(parent.getParameters());
setDescription(parent.getDescription()); setDescription(parent.getDescription());
inheritPermission(); inheritPermission();
} }
@ -58,12 +58,10 @@ public class DefaultHelpCommand extends CompositeCommand {
} }
if (depth < MAX_DEPTH) { if (depth < MAX_DEPTH) {
if (!parent.getLabel().equals(HELP)) { if (!parent.getLabel().equals(HELP)) {
// Get elements // Get elements
String usage = parent.getUsage(); String usage = parent.getUsage();
String params = user.getTranslationOrNothing(getParameters()); String params = user.getTranslationOrNothing(getParameters());
String desc = user.getTranslationOrNothing(getDescription()); String desc = user.getTranslation(getDescription());
if (showPrettyHelp(user, usage, params, desc)) { if (showPrettyHelp(user, usage, params, desc)) {
// No more to show // No more to show