diff --git a/client/ui/frontend/src/components/CopyToClipboard.tsx b/client/ui/frontend/src/components/CopyToClipboard.tsx index d04dc3e57..8fcbd77f3 100644 --- a/client/ui/frontend/src/components/CopyToClipboard.tsx +++ b/client/ui/frontend/src/components/CopyToClipboard.tsx @@ -1,4 +1,5 @@ import { useEffect, useRef, useState, type ReactNode } from "react"; +import { useTranslation } from "react-i18next"; import { Check, Copy } from "lucide-react"; import { cn } from "@/lib/cn"; @@ -18,6 +19,7 @@ type CopyToClipboardProps = { iconClassName?: string; alwaysShowIcon?: boolean; variant?: CopyToClipboardVariant; + "aria-label"?: string; }; export const CopyToClipboard = ({ @@ -29,7 +31,9 @@ export const CopyToClipboard = ({ iconClassName, alwaysShowIcon = false, variant = "default", + "aria-label": ariaLabel, }: CopyToClipboardProps) => { + const { t } = useTranslation(); const wrapperRef = useRef(null); const [copied, setCopied] = useState(false); const copyTimer = useRef | null>(null); @@ -55,11 +59,16 @@ export const CopyToClipboard = ({ } }; + const resolvedLabel = + ariaLabel ?? (message ? `${t("common.copy")} ${message}` : t("common.copy")); + return ( @@ -119,11 +130,19 @@ export function LanguagePicker() { )} >
-
- +
+