diff --git a/webview-ui/src/components/human-relay/HumanRelayDialog.tsx b/webview-ui/src/components/human-relay/HumanRelayDialog.tsx index 61d4cbe213..87af4832c6 100644 --- a/webview-ui/src/components/human-relay/HumanRelayDialog.tsx +++ b/webview-ui/src/components/human-relay/HumanRelayDialog.tsx @@ -4,6 +4,7 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D import { Textarea } from "../ui/textarea" import { useClipboard } from "../ui/hooks" import { Check, Copy, X } from "lucide-react" +import { useAppTranslation } from "@/i18n/TranslationContext" interface HumanRelayDialogProps { isOpen: boolean @@ -26,11 +27,12 @@ export const HumanRelayDialog: React.FC = ({ onSubmit, onCancel, }) => { + const { t } = useAppTranslation() const [response, setResponse] = React.useState("") const { copy } = useClipboard() const [isCopyClicked, setIsCopyClicked] = React.useState(false) - // Listen to isOpen changes, clear the input box when the dialog box is opened + // Clear input when dialog opens React.useEffect(() => { if (isOpen) { setResponse("") @@ -38,7 +40,7 @@ export const HumanRelayDialog: React.FC = ({ } }, [isOpen]) - // Copy to clipboard and show a success message + // Copy to clipboard and show success message const handleCopy = () => { copy(promptText) setIsCopyClicked(true) @@ -47,7 +49,7 @@ export const HumanRelayDialog: React.FC = ({ }, 2000) } - // Submit the response + // Submit response const handleSubmit = (e: React.FormEvent) => { e.preventDefault() if (response.trim()) { @@ -56,7 +58,7 @@ export const HumanRelayDialog: React.FC = ({ } } - // Cancel the operation + // Cancel operation const handleCancel = () => { onCancel(requestId) onClose() @@ -66,10 +68,8 @@ export const HumanRelayDialog: React.FC = ({ !open && handleCancel()}> - Human Relay - Please Help Copy and Paste Information - - Please copy the text below to the web AI, then paste the AI's response into the input box below. - + {t("humanRelay:dialogTitle")} + {t("humanRelay:dialogDescription")}
@@ -84,12 +84,14 @@ export const HumanRelayDialog: React.FC = ({
- {isCopyClicked &&
Copied to clipboard
} + {isCopyClicked && ( +
{t("humanRelay:copiedToClipboard")}
+ )}
-
Please enter the AI's response:
+
{t("humanRelay:aiResponse.label")}