def METHOD_NAME(self, num_parent_objects, num_child_objects):
    include_descendants = self.cleaned_form.cleaned_data["include_descendants"]
    if num_parent_objects == 1:
        if include_descendants:
            if num_child_objects == 0:
                success_message = _("1 page has been published")
            else:
                success_message = ngettext(
                    "1 page and %(num_child_objects)d child page have been published",
                    "1 page and %(num_child_objects)d child pages have been published",
                    num_child_objects,
                ) % {"num_child_objects": num_child_objects}
        else:
            success_message = _("1 page has been published")
    else:
        if include_descendants:
            if num_child_objects == 0:
                success_message = _(
                    "%(num_parent_objects)d pages have been published"
                ) % {"num_parent_objects": num_parent_objects}
            else:
                success_message = ngettext(
                    "%(num_parent_objects)d pages and %(num_child_objects)d child page have been published",
                    "%(num_parent_objects)d pages and %(num_child_objects)d child pages have been published",
                    num_child_objects,
                ) % {
                    "num_child_objects": num_child_objects,
                    "num_parent_objects": num_parent_objects,
                }
        else:
            success_message = _(
                "%(num_parent_objects)d pages have been published"
            ) % {"num_parent_objects": num_parent_objects}
    return success_message