From cd5adce7dff6b32ef44dedc25c7d3aea529ca998 Mon Sep 17 00:00:00 2001 From: Ephraim Duncan <55143799+ephraimduncan@users.noreply.github.com> Date: Fri, 22 Nov 2024 07:22:31 +0000 Subject: [PATCH] fix: hardcode delete confirmation text to avoid translation mismatch (#1487) --- .../app/(dashboard)/documents/delete-document-dialog.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx b/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx index 912de8f11..84f554353 100644 --- a/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx +++ b/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx @@ -47,6 +47,8 @@ export const DeleteDocumentDialog = ({ const { refreshLimits } = useLimits(); const { _ } = useLingui(); + const deleteMessage = msg`delete`; + const [inputValue, setInputValue] = useState(''); const [isDeleteEnabled, setIsDeleteEnabled] = useState(status === DocumentStatus.DRAFT); @@ -87,7 +89,7 @@ export const DeleteDocumentDialog = ({ const onInputChange = (event: React.ChangeEvent) => { setInputValue(event.target.value); - setIsDeleteEnabled(event.target.value === _(msg`delete`)); + setIsDeleteEnabled(event.target.value === _(deleteMessage)); }; return ( @@ -181,7 +183,7 @@ export const DeleteDocumentDialog = ({ type="text" value={inputValue} onChange={onInputChange} - placeholder={_(msg`Type 'delete' to confirm`)} + placeholder={_(msg`Please type ${`'${_(deleteMessage)}'`} to confirm`)} /> )}