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>
This commit is contained in:
@@ -183,19 +183,19 @@ const TextInputArea = forwardRef<HTMLTextAreaElement, TextInputAreaProps>((props
|
|||||||
onChange?.('');
|
onChange?.('');
|
||||||
setError('');
|
setError('');
|
||||||
internalRef.current?.focus();
|
internalRef.current?.focus();
|
||||||
toast.success('已清空内容');
|
toast.success(t('textInputArea.cleared'));
|
||||||
onClear?.();
|
onClear?.();
|
||||||
}, [isControlled, onChange, onClear]);
|
}, [isControlled, onChange, onClear, t]);
|
||||||
|
|
||||||
const handleCopy = useCallback(async () => {
|
const handleCopy = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(value);
|
await navigator.clipboard.writeText(value);
|
||||||
toast.success('复制成功');
|
toast.success(t('messages.copySuccess'));
|
||||||
} catch {
|
} catch {
|
||||||
setError('复制失败');
|
setError(t('messages.copyError'));
|
||||||
toast.error('复制失败');
|
toast.error(t('messages.copyError'));
|
||||||
}
|
}
|
||||||
}, [value]);
|
}, [value, t]);
|
||||||
|
|
||||||
const handleAction = useCallback(
|
const handleAction = useCallback(
|
||||||
(action: ToolbarAction) => {
|
(action: ToolbarAction) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user