From e0de152645981472a53a6e266bb4dd40d7eed139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E9=9C=96=E9=93=83?= Date: Wed, 27 May 2026 13:49:31 +0800 Subject: [PATCH] fix(TextInputArea): replace hardcoded Chinese strings with i18n t() calls Use existing translation keys for clear success, copy success, and copy error messages instead of hardcoded Chinese text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- components/TextInputArea.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/TextInputArea.tsx b/components/TextInputArea.tsx index 1cd441c..f0b32e3 100644 --- a/components/TextInputArea.tsx +++ b/components/TextInputArea.tsx @@ -183,19 +183,19 @@ const TextInputArea = forwardRef((props onChange?.(''); setError(''); internalRef.current?.focus(); - toast.success('已清空内容'); + toast.success(t('textInputArea.cleared')); onClear?.(); - }, [isControlled, onChange, onClear]); + }, [isControlled, onChange, onClear, t]); const handleCopy = useCallback(async () => { try { await navigator.clipboard.writeText(value); - toast.success('复制成功'); + toast.success(t('messages.copySuccess')); } catch { - setError('复制失败'); - toast.error('复制失败'); + setError(t('messages.copyError')); + toast.error(t('messages.copyError')); } - }, [value]); + }, [value, t]); const handleAction = useCallback( (action: ToolbarAction) => {