Repository: wagtail/wagtail
File: wagtail/admin/templatetags/wagtailadmin_tags.py (Python)

Code before:
    user_agent = context["request"].headers.get("User-Agent", "")
    is_mac = re.search(r"Mac|iPod|iPhone|iPad", user_agent)
    modifier = "⌘" if is_mac else "Ctrl"

    return {
        "shortcuts": {
            ("actions-common", _("Common actions")): [
                (_("Copy"), f"{modifier} + c"),
                (_("Cut"), f"{modifier} + x"),
                (_("Paste"), f"{modifier} + v"),
                (
                    _("Paste and match style")
                    if is_mac
                    else _("Paste without formatting"),
                    f"{modifier} + Shift + v",
                ),
                (_("Undo"), f"{modifier} + z"),
                (
                    _("Redo"),
                    f"{modifier} + Shift + z" if is_mac else f"{modifier} + y",
                ),
            ],
            ("actions-model", _("Actions")): [
                (_("Save changes"), f"{modifier} + s"),
                (_("Preview"), f"{modifier} + p"),
                (_("Main menu"), f"{modifier} + ["),
            ],
            ("rich-text-content", _("Text content")): [
                (_("Insert or edit a link"), f"{modifier} + k")
            ],
            ("rich-text-formatting", _("Text formatting")): [
                (_("Bold"), f"{modifier} + b"),
                (_("Italic"), f"{modifier} + i"),
                (_("Underline"), f"{modifier} + u"),
                (_("Monospace (code)"), f"{modifier} + j"),
                (_("Strike-through"), f"{modifier} + x"),
                (_("Superscript"), f"{modifier} + ."),
                (_("Subscript"), f"{modifier} + ,"),
            ],
        }
    }


@register.inclusion_tag("wagtailadmin/shared/human_readable_date.html")
def human_readable_date(date, description=None, placement="top"):
    if isinstance(date, datetime.datetime):
        tooltip_format = getattr(settings, "DATETIME_FORMAT", "N j, Y, P")
    elif isinstance(date, datetime.date):
        tooltip_format = getattr(settings, "DATE_FORMAT", "N j, Y")
    return {
        "date": date,

Review comment (suggestion):
Let's use the same terminology/label as we provide to screen readers for the actual button.

```suggestion
                (_("Toggle sidebar"), f"{modifier} + ["),
```

![Screenshot 2025-03-09 at 5 34 57 PM](https://github.com/user-attachments/assets/591b91ec-b0fd-4cd8-8191-be14a72340a8)



Code after:
                (_("Superscript"), f"{KEYS.MOD} + ."),
                (_("Subscript"), f"{KEYS.MOD} + ,"),
            ],
        }
    }


@register.inclusion_tag("wagtailadmin/shared/human_readable_date.html")
def human_readable_date(date, description=None, placement="top"):
    if isinstance(date, datetime.datetime):
        tooltip_format = get_format("DATETIME_FORMAT") or "N j, Y, P"
    elif isinstance(date, datetime.date):
        tooltip_format = get_format("DATE_FORMAT") or "N j, Y"
    return {
        "date": date,
        "description": description,
        "placement": placement,
        "tooltip_format": tooltip_format,
    }


# Shadow the laces `component` tag which was extracted from Wagtail. The shadowing
# is useful to avoid having to update all the templates that use the `component` tag.
register.tag("component", component)


register.simple_tag(get_icon_sprite_url, name="icon_sprite_url")