Repository: wagtail/wagtail
File: wagtail/admin/wagtail_hooks.py (Python)

Code before:
        "draftail", "hr", draftail_features.BooleanFeature("enableHorizontalRule")
    )
    features.register_converter_rule(
        "contentstate",
        "hr",
        {
            "from_database_format": {
                "hr": HorizontalRuleHandler(),
            },
            "to_database_format": {
                "entity_decorators": {
                    "HORIZONTAL_RULE": lambda props: DOM.create_element("hr")
                }
            },
        },
    )

    features.register_editor_plugin(
        "draftail",
        "h1",
        draftail_features.BlockFeature(
            {
                "icon": "h1",
                "type": "header-one",
                # FIXME: interpolation causes immediate evaluation
                "description": _("Heading %(level)d") % {"level": 1},
            }
        ),
    )
    features.register_converter_rule(
        "contentstate",
        "h1",
        {
            "from_database_format": {
                "h1": BlockElementHandler("header-one"),
            },
            "to_database_format": {"block_map": {"header-one": "h1"}},
        },
    )
    features.register_editor_plugin(
        "draftail",
        "h2",
        draftail_features.BlockFeature(
            {
                "icon": "h2",
                "type": "header-two",
                "description": _("Heading %(level)d") % {"level": 2},
            }
        ),
    )
    features.register_converter_rule(

Review comment (suggestion):
I reverted your change to use dedicated strings for each heading for now. I like the idea compared to the alternatives, but it is going to be quite a bit of work to backport the fix to the release branches, as we'll need to update the translation strings too.

I think we should focus on getting the `JavaScriptCatalog` localized in this PR (along with the other quick wins like swapping `gettext` with `gettext_lazy`), and revisit the heading labels issue in a separate PR for the `main` branch.

Code after:
    features.register_editor_plugin(
        "draftail", "hr", draftail_features.BooleanFeature("enableHorizontalRule")
    )
    features.register_converter_rule(
        "contentstate",
        "hr",
        {
            "from_database_format": {
                "hr": HorizontalRuleHandler(),
            },
            "to_database_format": {
                "entity_decorators": {
                    "HORIZONTAL_RULE": lambda props: DOM.create_element("hr")
                }
            },
        },
    )

    features.register_editor_plugin(
        "draftail",
        "h1",
        draftail_features.BlockFeature(
            {
                "icon": "h1",
                "type": "header-one",
                "description": gettext("Heading %(level)d") % {"level": 1},
            }
        ),
    )
    features.register_converter_rule(
        "contentstate",
        "h1",
        {
            "from_database_format": {
                "h1": BlockElementHandler("header-one"),
            },
            "to_database_format": {"block_map": {"header-one": "h1"}},
        },
    )
    features.register_editor_plugin(
        "draftail",
        "h2",
        draftail_features.BlockFeature(
            {
                "icon": "h2",
                "type": "header-two",
                "description": gettext("Heading %(level)d") % {"level": 2},
            }
        ),
    )
    features.register_converter_rule(