snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Failing after 15s

This commit is contained in:
upstream-mirror
2026-09-16 05:31:04 +05:00
commit 1a8d07ca6c
1286 changed files with 360144 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { isDarwin } from "@excalidraw/common";
import { t } from "./i18n";
export const getShortcutKey = (shortcut: string): string =>
shortcut
.replace(
/\b(Opt(?:ion)?|Alt)\b/i,
isDarwin ? t("keys.option") : t("keys.alt"),
)
.replace(/\bShift\b/i, t("keys.shift"))
.replace(/\b(Enter|Return)\b/i, t("keys.enter"))
.replace(
/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,
isDarwin ? t("keys.cmd") : t("keys.ctrl"),
)
.replace(/\b(Esc(?:ape)?)\b/i, t("keys.escape"))
.replace(/\b(Space(?:bar)?)\b/i, t("keys.spacebar"))
.replace(/\b(Del(?:ete)?)\b/i, t("keys.delete"));