fix(i18n): mark missing toast messages for translation (#2274)

This commit is contained in:
Konrad
2025-12-04 04:00:25 +01:00
committed by GitHub
parent 22d99c7410
commit 1275a15571
10 changed files with 28 additions and 24 deletions
@@ -45,7 +45,7 @@ export const AdminDocumentDeleteDialog = ({ envelopeId }: AdminDocumentDeleteDia
toast({
title: _(msg`Document deleted`),
description: 'The Document has been deleted successfully.',
description: _(msg`The Document has been deleted successfully.`),
duration: 5000,
});
@@ -54,8 +54,9 @@ export const AdminDocumentDeleteDialog = ({ envelopeId }: AdminDocumentDeleteDia
toast({
title: _(msg`An unknown error occurred`),
variant: 'destructive',
description:
'We encountered an unknown error while attempting to delete your document. Please try again later.',
description: _(
msg`We encountered an unknown error while attempting to delete your document. Please try again later.`,
),
});
}
};
@@ -103,8 +103,8 @@ export const TemplateBulkSendDialog = ({
console.error(err);
toast({
title: 'Error',
description: 'Failed to upload CSV. Please check the file format and try again.',
title: _(msg`Error`),
description: _(msg`Failed to upload CSV. Please check the file format and try again.`),
variant: 'destructive',
});
}
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { Trans } from '@lingui/react/macro';
import type { EnvelopeItem, FieldType } from '@prisma/client';
@@ -229,8 +230,8 @@ export const ConfigureFieldsView = ({
setFieldClipboard(lastActiveField);
toast({
title: 'Copied field',
description: 'Copied field to clipboard',
title: _(msg`Copied field`),
description: _(msg`Copied field to clipboard`),
});
}
},
@@ -150,8 +150,8 @@ export const MultiSignDocumentSigningView = ({
onDocumentError?.();
toast({
title: 'Error',
description: 'Failed to complete the document. Please try again.',
title: _(msg`Error`),
description: _(msg`Failed to complete the document. Please try again.`),
variant: 'destructive',
});
} finally {
+1 -1
View File
@@ -201,7 +201,7 @@ export const SignInForm = ({
.otherwise(() => handleFallbackErrorMessages(error.code));
toast({
title: 'Something went wrong',
title: _(msg`Something went wrong`),
description: _(errorMessage),
duration: 10000,
variant: 'destructive',
@@ -108,8 +108,8 @@ export const DocumentSigningForm = ({
await completeDocument({ nextSigner });
} catch (err) {
toast({
title: 'Error',
description: 'An error occurred while completing the document. Please try again.',
title: _(msg`Error`),
description: _(msg`An error occurred while completing the document. Please try again.`),
variant: 'destructive',
});
@@ -74,8 +74,8 @@ export function DocumentSigningRejectDialog({
});
toast({
title: 'Document rejected',
description: 'The document has been successfully rejected.',
title: t`Document rejected`,
description: t`The document has been successfully rejected.`,
duration: 5000,
});
@@ -88,8 +88,8 @@ export function DocumentSigningRejectDialog({
}
} catch (err) {
toast({
title: 'Error',
description: 'An error occurred while rejecting the document. Please try again.',
title: t`Error`,
description: t`An error occurred while rejecting the document. Please try again.`,
variant: 'destructive',
duration: 5000,
});
@@ -1,6 +1,7 @@
import { useState } from 'react';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { Trans } from '@lingui/react/macro';
import { AlertTriangle, Building2, Database, Eye, Settings, UserCircle2 } from 'lucide-react';
import { data, isRouteErrorResponse } from 'react-router';
@@ -125,6 +126,7 @@ export async function loader({ params }: Route.LoaderArgs) {
export default function OrganisationSsoConfirmationTokenPage({ loaderData }: Route.ComponentProps) {
const { token, type, user, organisation } = loaderData;
const { _ } = useLingui();
const { toast } = useToast();
const navigate = useNavigate();
@@ -136,12 +138,12 @@ export default function OrganisationSsoConfirmationTokenPage({ loaderData }: Rou
await navigate('/');
toast({
title: 'Account link declined',
title: _(msg`Account link declined`),
});
},
onError: (error) => {
toast({
title: 'Error declining account link',
title: _(msg`Error declining account link`),
description: error.message,
});
},
@@ -153,12 +155,12 @@ export default function OrganisationSsoConfirmationTokenPage({ loaderData }: Rou
await navigate(formatOrganisationLoginPath(organisation.url));
toast({
title: 'Account linked successfully',
title: _(msg`Account linked successfully`),
});
},
onError: (error) => {
toast({
title: 'Error linking account',
title: _(msg`Error linking account`),
description: error.message,
});
},
@@ -457,8 +457,8 @@ export const AddFieldsFormPartial = ({
setFieldClipboard(lastActiveField);
toast({
title: 'Copied field',
description: 'Copied field to clipboard',
title: _(msg`Copied field`),
description: _(msg`Copied field to clipboard`),
});
}
},
@@ -217,8 +217,8 @@ export const AddTemplateFieldsFormPartial = ({
setFieldClipboard(lastActiveField);
toast({
title: 'Copied field',
description: 'Copied field to clipboard',
title: _(msg`Copied field`),
description: _(msg`Copied field to clipboard`),
});
}
},