class HelpMessagesService {

    public CommandDescription buildLocalizedDescription(CommandDescription command) {
        final String path = COMMAND_PREFIX + getCommandSubPath(command);
        if (!helpMessagesFileHandler.hasSection(path)) {
            // Messages file does not have a section for this command - return the provided command
            return command;
        }

        CommandDescription.CommandBuilder builder = CommandDescription.builder()
            .description(getText(path + DESCRIPTION_SUFFIX, command::getDescription))
            .detailedDescription(getText(path + DETAILED_DESCRIPTION_SUFFIX, command::getDetailedDescription))
            .executableCommand(command.getExecutableCommand())
            .parent(command.getParent())
            .labels(command.getLabels())
            .permission(command.getPermission());

        int i = 1;
        for (CommandArgumentDescription argument : command.getArguments()) {
            String argPath = path + ".arg" + i;
            String label = getText(argPath + ".label", argument::getName);
            String description = getText(argPath + ".description", argument::getDescription);
            builder.withArgument(label, description, argument.isOptional());
            ++i;
        }

        CommandDescription localCommand = builder.build();
        localCommand.getChildren().addAll(command.getChildren());
        return localCommand;
    }

    @Inject  HelpMessagesService(HelpMessagesFileHandler helpMessagesFileHandler);

}