From 8b4447ccb310e5eacf3729c8573465895e10f83b Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 12:54:56 +0000 Subject: [PATCH 01/11] fix(web): add internationalization support for data table action dropdown and sender filter components feat(web): integrate i18n library to enable translation of text labels in the UI components --- .../documents/data-table-action-dropdown.tsx | 29 ++++++++++--------- .../documents/data-table-sender-filter.tsx | 6 ++-- packages/lib/i18n/locales/en/web.json | 19 +++++++++++- packages/lib/i18n/locales/fr/web.json | 19 +++++++++++- 4 files changed, 55 insertions(+), 18 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx b/apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx index 2bd888bb0f..5454d3ae60 100644 --- a/apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx +++ b/apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx @@ -20,6 +20,7 @@ import { import { useSession } from 'next-auth/react'; import { downloadPDF } from '@documenso/lib/client-only/download-pdf'; +import { useTranslation } from '@documenso/lib/i18n/client'; import { formatDocumentsPath } from '@documenso/lib/utils/teams'; import { DocumentStatus, RecipientRole } from '@documenso/prisma/client'; import type { Document, Recipient, Team, User } from '@documenso/prisma/client'; @@ -51,7 +52,7 @@ export type DataTableActionDropdownProps = { export const DataTableActionDropdown = ({ row, team }: DataTableActionDropdownProps) => { const { data: session } = useSession(); const { toast } = useToast(); - + const { t } = useTranslation('web'); const [isDeleteDialogOpen, setDeleteDialogOpen] = useState(false); const [isDuplicateDialogOpen, setDuplicateDialogOpen] = useState(false); @@ -96,8 +97,8 @@ export const DataTableActionDropdown = ({ row, team }: DataTableActionDropdownPr await downloadPDF({ documentData, fileName: row.title }); } catch (err) { toast({ - title: 'Something went wrong', - description: 'An error occurred while downloading your document.', + title: t('something-went-wrong'), + description: t('an-error-occurred-while-downloading-your-document'), variant: 'destructive', }); } @@ -112,7 +113,7 @@ export const DataTableActionDropdown = ({ row, team }: DataTableActionDropdownPr - Action + {t('action')} {recipient && recipient?.role !== RecipientRole.CC && ( @@ -120,21 +121,21 @@ export const DataTableActionDropdown = ({ row, team }: DataTableActionDropdownPr {recipient?.role === RecipientRole.VIEWER && ( <> - View + {t('view')} )} {recipient?.role === RecipientRole.SIGNER && ( <> - Sign + {t('sign')} )} {recipient?.role === RecipientRole.APPROVER && ( <> - Approve + {t('approve')} )} @@ -144,31 +145,31 @@ export const DataTableActionDropdown = ({ row, team }: DataTableActionDropdownPr - Edit + {t('edit')} - Download + {t('download')} setDuplicateDialogOpen(true)}> - Duplicate + {t('duplicate')} - Void + {t('void')} setDeleteDialogOpen(true)} disabled={!isDocumentDeletable}> - Delete + {t('delete')} - Share + {t('share')} @@ -179,7 +180,7 @@ export const DataTableActionDropdown = ({ row, team }: DataTableActionDropdownPr e.preventDefault()}>
{loading ? : } - Share Signing Card + {t('share-signing-card')}
)} diff --git a/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx b/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx index 6c66153a7e..d12b54bb51 100644 --- a/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx +++ b/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx @@ -6,12 +6,14 @@ import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted'; import { parseToIntegerArray } from '@documenso/lib/utils/params'; import { trpc } from '@documenso/trpc/react'; import { MultiSelectCombobox } from '@documenso/ui/primitives/multi-select-combobox'; +import { useTranslation } from '@documenso/lib/i18n/client'; type DataTableSenderFilterProps = { teamId: number; }; export const DataTableSenderFilter = ({ teamId }: DataTableSenderFilterProps) => { + const { t } = useTranslation('web'); const pathname = usePathname(); const searchParams = useSearchParams(); const router = useRouter(); @@ -49,11 +51,11 @@ export const DataTableSenderFilter = ({ teamId }: DataTableSenderFilterProps) => - Sender: All + {t('senderlabel')} {t('all')}

} enableClearAllButton={true} - inputPlaceholder="Search" + inputPlaceholder={t('search')} loading={!isMounted || isInitialLoading} options={comboBoxOptions} selectedValues={senderIds} diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 9e26dfeeb6..559d393cfb 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -1 +1,18 @@ -{} \ No newline at end of file +{ + "action": "Action", + "all": "All", + "an-error-occurred-while-downloading-your-document": "An error occurred while downloading your document.", + "approve": "Approve", + "delete": "Delete", + "download": "Download", + "duplicate": "Duplicate", + "edit": "Edit", + "search": "Search", + "share": "Share", + "share-signing-card": "Share Signing Card", + "sign": "Sign", + "something-went-wrong": "Something went wrong", + "view": "View", + "void": "Void", + "senderlabel": "Sender:" +} diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 9e26dfeeb6..00edadebb2 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -1 +1,18 @@ -{} \ No newline at end of file +{ + "action": "", + "all": "", + "an-error-occurred-while-downloading-your-document": "", + "approve": "", + "delete": "", + "download": "", + "duplicate": "", + "edit": "", + "search": "", + "share": "", + "share-signing-card": "", + "sign": "", + "something-went-wrong": "", + "view": "", + "void": "", + "senderlabel": "" +} From 91c1bdae017c67d0d8c2d24553a144c989f8b8c5 Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 13:51:37 +0000 Subject: [PATCH 02/11] fix(web): change variable name from 'port' to 'PORT' for consistency and clarity feat(web): add support for process.env.PORT to allow running the app on a configurable port feat(web): add translation support for headers in data-table.tsx and page.tsx feat(web): add translation support for admin nav links in nav.tsx feat(web): add translation support for DataTableActionButton component messages feat(web): add translation support for DataTableSenderFilter component feat(web): add translation support for headers and actions in documents data-table components feat(web): add translation support for DeleteDocumentDialog component messages feat(web): add translation support for NotFoundPartial component messages feat(web): update domain in PlausibleProvider component to 'montampon.com' feat(web): add English translations for web.json in i18n locales --- .../admin/documents/data-table.tsx | 11 +++---- .../app/(dashboard)/admin/documents/page.tsx | 3 +- apps/web/src/app/(dashboard)/admin/nav.tsx | 9 +++--- .../documents/data-table-action-button.tsx | 19 ++++++------ .../documents/data-table-sender-filter.tsx | 2 +- .../app/(dashboard)/documents/data-table.tsx | 13 +++++---- .../documents/delete-document-dialog.tsx | 22 +++++++------- .../web/src/components/partials/not-found.tsx | 12 ++++---- apps/web/src/providers/plausible.tsx | 2 +- packages/lib/i18n/locales/en/web.json | 29 +++++++++++++++++-- packages/lib/i18n/locales/fr/web.json | 29 +++++++++++++++++-- 11 files changed, 102 insertions(+), 49 deletions(-) diff --git a/apps/web/src/app/(dashboard)/admin/documents/data-table.tsx b/apps/web/src/app/(dashboard)/admin/documents/data-table.tsx index 0fc660968a..0882e80e16 100644 --- a/apps/web/src/app/(dashboard)/admin/documents/data-table.tsx +++ b/apps/web/src/app/(dashboard)/admin/documents/data-table.tsx @@ -28,6 +28,7 @@ export type DocumentsDataTableProps = { export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => { const [isPending, startTransition] = useTransition(); + const { t } = useTranslation('web'); const updateSearchParams = useUpdateSearchParams(); @@ -45,12 +46,12 @@ export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => { , }, { - header: 'Title', + header: t('title'), accessorKey: 'title', cell: ({ row }) => { return ( @@ -61,7 +62,7 @@ export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => { }, }, { - header: 'Owner', + header: t('owner'), accessorKey: 'owner', cell: ({ row }) => { const avatarFallbackText = row.original.User.name @@ -96,12 +97,12 @@ export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => { }, }, { - header: 'Last updated', + header: t('last-updated'), accessorKey: 'updatedAt', cell: ({ row }) => , }, { - header: 'Status', + header: t('status'), accessorKey: 'status', cell: ({ row }) => , }, diff --git a/apps/web/src/app/(dashboard)/admin/documents/page.tsx b/apps/web/src/app/(dashboard)/admin/documents/page.tsx index 2fbbcd4dc9..c5a795c532 100644 --- a/apps/web/src/app/(dashboard)/admin/documents/page.tsx +++ b/apps/web/src/app/(dashboard)/admin/documents/page.tsx @@ -12,6 +12,7 @@ export type DocumentsPageProps = { export default async function Documents({ searchParams = {} }: DocumentsPageProps) { const page = Number(searchParams.page) || 1; const perPage = Number(searchParams.perPage) || 20; + const { t } = useTranslation('web'); const results = await findDocuments({ page, @@ -20,7 +21,7 @@ export default async function Documents({ searchParams = {} }: DocumentsPageProp return (
-

Manage documents

+

{t('manage-documents')}

diff --git a/apps/web/src/app/(dashboard)/admin/nav.tsx b/apps/web/src/app/(dashboard)/admin/nav.tsx index c60fba59fb..ff361dd0cd 100644 --- a/apps/web/src/app/(dashboard)/admin/nav.tsx +++ b/apps/web/src/app/(dashboard)/admin/nav.tsx @@ -14,6 +14,7 @@ export type AdminNavProps = HTMLAttributes; export const AdminNav = ({ className, ...props }: AdminNavProps) => { const pathname = usePathname(); + const { t } = useTranslation('web'); return (
{ > - Stats + {t('stats')} @@ -47,7 +48,7 @@ export const AdminNav = ({ className, ...props }: AdminNavProps) => { > - Users + {t('users')} @@ -61,7 +62,7 @@ export const AdminNav = ({ className, ...props }: AdminNavProps) => { > - Documents + {t('documents')} @@ -75,7 +76,7 @@ export const AdminNav = ({ className, ...props }: AdminNavProps) => { > - Subscriptions + {t('subscriptions')}
diff --git a/apps/web/src/app/(dashboard)/documents/data-table-action-button.tsx b/apps/web/src/app/(dashboard)/documents/data-table-action-button.tsx index 78ffd0b3ba..1d40e2e6b8 100644 --- a/apps/web/src/app/(dashboard)/documents/data-table-action-button.tsx +++ b/apps/web/src/app/(dashboard)/documents/data-table-action-button.tsx @@ -27,6 +27,7 @@ export type DataTableActionButtonProps = { export const DataTableActionButton = ({ row, team }: DataTableActionButtonProps) => { const { data: session } = useSession(); const { toast } = useToast(); + const { t } = useTranslation('web'); if (!session) { return null; @@ -63,14 +64,14 @@ export const DataTableActionButton = ({ row, team }: DataTableActionButtonProps) const documentData = document?.documentData; if (!documentData) { - throw Error('No document available'); + throw Error(t('no-document-available')); } await downloadPDF({ documentData, fileName: row.title }); } catch (err) { toast({ - title: 'Something went wrong', - description: 'An error occurred while downloading your document.', + title: t('something-went-wrong'), + description: t('an-error-occurred-while-downloading-your-document'), variant: 'destructive', }); } @@ -96,7 +97,7 @@ export const DataTableActionButton = ({ row, team }: DataTableActionButtonProps) ), @@ -108,19 +109,19 @@ export const DataTableActionButton = ({ row, team }: DataTableActionButtonProps) .with(RecipientRole.SIGNER, () => ( <> - Sign + {t('sign')} )) .with(RecipientRole.APPROVER, () => ( <> - Approve + {t('approve')} )) .otherwise(() => ( <> - View + {t('view')} ))} @@ -129,13 +130,13 @@ export const DataTableActionButton = ({ row, team }: DataTableActionButtonProps) .with({ isPending: true, isSigned: true }, () => ( )) .with({ isComplete: true }, () => ( )) .otherwise(() =>
); diff --git a/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx b/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx index d12b54bb51..7d29e532fd 100644 --- a/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx +++ b/apps/web/src/app/(dashboard)/documents/data-table-sender-filter.tsx @@ -3,10 +3,10 @@ import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted'; +import { useTranslation } from '@documenso/lib/i18n/client'; import { parseToIntegerArray } from '@documenso/lib/utils/params'; import { trpc } from '@documenso/trpc/react'; import { MultiSelectCombobox } from '@documenso/ui/primitives/multi-select-combobox'; -import { useTranslation } from '@documenso/lib/i18n/client'; type DataTableSenderFilterProps = { teamId: number; diff --git a/apps/web/src/app/(dashboard)/documents/data-table.tsx b/apps/web/src/app/(dashboard)/documents/data-table.tsx index 13b85d526e..027049e631 100644 --- a/apps/web/src/app/(dashboard)/documents/data-table.tsx +++ b/apps/web/src/app/(dashboard)/documents/data-table.tsx @@ -39,6 +39,7 @@ export const DocumentsDataTable = ({ }: DocumentsDataTableProps) => { const { data: session } = useSession(); const [isPending, startTransition] = useTransition(); + const { t } = useTranslation('web'); const updateSearchParams = useUpdateSearchParams(); @@ -60,33 +61,33 @@ export const DocumentsDataTable = ({ , }, { - header: 'Title', + header: t('title'), cell: ({ row }) => , }, { id: 'sender', - header: 'Sender', + header: t('sender'), cell: ({ row }) => row.original.User.name ?? row.original.User.email, }, { - header: 'Recipient', + header: t('recipient'), accessorKey: 'recipient', cell: ({ row }) => { return ; }, }, { - header: 'Status', + header: t('status'), accessorKey: 'status', cell: ({ row }) => , }, { - header: 'Actions', + header: t('actions'), cell: ({ row }) => (!row.original.deletedAt || row.original.status === ExtendedDocumentStatus.COMPLETED) && ( 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 38c01ed825..c1f5b691e8 100644 --- a/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx +++ b/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx @@ -32,6 +32,7 @@ export const DeleteDocumentDialog = ({ documentTitle, }: DeleteDraftDocumentDialogProps) => { const router = useRouter(); + const { t } = useTranslation('web'); const { toast } = useToast(); @@ -43,8 +44,8 @@ export const DeleteDocumentDialog = ({ router.refresh(); toast({ - title: 'Document deleted', - description: `"${documentTitle}" has been successfully deleted`, + title: t('document-deleted'), + description: t('documenttitle-has-been-successfully-deleted', { documentTitle }), duration: 5000, }); @@ -64,8 +65,8 @@ export const DeleteDocumentDialog = ({ await deleteDocument({ id, status }); } catch { toast({ - title: 'Something went wrong', - description: 'This document could not be deleted at this time. Please try again.', + title: t('something-went-wrong'), + description: t('this-document-could-not-be-deleted-at-this-time-please-try-again'), variant: 'destructive', duration: 7500, }); @@ -81,12 +82,9 @@ export const DeleteDocumentDialog = ({ !isLoading && onOpenChange(value)}> - Are you sure you want to delete "{documentTitle}"? + {t('are-you-sure-you-want-to-delete', { documentTitle })} - - Please note that this action is irreversible. Once confirmed, your document will be - permanently deleted. - + {t('please-note-that-this-action')} {status !== DocumentStatus.DRAFT && ( @@ -95,7 +93,7 @@ export const DeleteDocumentDialog = ({ type="text" value={inputValue} onChange={onInputChange} - placeholder="Type 'delete' to confirm" + placeholder={t('type-delete-to-confirm')} />
)} @@ -108,7 +106,7 @@ export const DeleteDocumentDialog = ({ onClick={() => onOpenChange(false)} className="flex-1" > - Cancel + {t('cancel')} diff --git a/apps/web/src/components/partials/not-found.tsx b/apps/web/src/components/partials/not-found.tsx index b80c6fea8c..9b56a13b44 100644 --- a/apps/web/src/components/partials/not-found.tsx +++ b/apps/web/src/components/partials/not-found.tsx @@ -6,6 +6,7 @@ import { useRouter } from 'next/navigation'; import { motion } from 'framer-motion'; import { ChevronLeft } from 'lucide-react'; +import { useTranslation } from '@documenso/lib/i18n/client'; import backgroundPattern from '@documenso/assets/images/background-pattern.png'; import { cn } from '@documenso/ui/lib/utils'; import { Button } from '@documenso/ui/primitives/button'; @@ -16,6 +17,7 @@ export type NotFoundPartialProps = { export default function NotFoundPartial({ children }: NotFoundPartialProps) { const router = useRouter(); + const { t } = useTranslation('web'); return (
@@ -36,13 +38,11 @@ export default function NotFoundPartial({ children }: NotFoundPartialProps) {
-

404 Page not found

+

{t('404-page-not-found')}

-

Oops! Something went wrong.

+

{t('oops-something-went-wrong')}

-

- The page you are looking for was moved, removed, renamed or might never have existed. -

+

{t('the-page-you-are-looking')}

{children} diff --git a/apps/web/src/providers/plausible.tsx b/apps/web/src/providers/plausible.tsx index dceaa4d93f..451dd5f7fc 100644 --- a/apps/web/src/providers/plausible.tsx +++ b/apps/web/src/providers/plausible.tsx @@ -9,5 +9,5 @@ export type PlausibleProviderProps = { }; export const PlausibleProvider = ({ children }: PlausibleProviderProps) => { - return {children}; + return {children}; }; diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 559d393cfb..3a9156b208 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -1,18 +1,43 @@ { + "404-page-not-found": "404 Page not found", "action": "Action", + "actions": "Actions", "all": "All", "an-error-occurred-while-downloading-your-document": "An error occurred while downloading your document.", "approve": "Approve", + "are-you-sure-you-want-to-delete": "Are you sure you want to delete {{documentTitle}}? ", + "cancel": "Cancel", + "created": "Created", "delete": "Delete", + "document-deleted": "Document deleted", + "documents": "Documents", + "documenttitle-has-been-successfully-deleted": "\"{{documentTitle}}\" has been successfully deleted", "download": "Download", "duplicate": "Duplicate", "edit": "Edit", + "go-back": "Go Back", + "last-updated": "Last updated", + "manage-documents": "Manage documents", + "no-document-available": "No document available", + "oops-something-went-wrong": "Oops! Something went wrong.", + "owner": "Owner", + "please-note-that-this-action": "Please note that this action is irreversible. Once confirmed, your document will be permanently deleted.", + "recipient": "Recipient", "search": "Search", + "sender": "Sender", + "senderlabel": "Sender:", "share": "Share", "share-signing-card": "Share Signing Card", "sign": "Sign", "something-went-wrong": "Something went wrong", + "stats": "Stats", + "status": "Status", + "subscriptions": "Subscriptions", + "the-page-you-are-looking": "The page you are looking for was moved, removed, renamed or might never have existed.", + "this-document-could-not-be-deleted-at-this-time-please-try-again": "This document could not be deleted at this time. Please try again.", + "title": "Title", + "type-delete-to-confirm": "Type 'delete' to confirm", + "users": "Users", "view": "View", - "void": "Void", - "senderlabel": "Sender:" + "void": "Void" } diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 00edadebb2..3e682be9eb 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -1,18 +1,43 @@ { + "404-page-not-found": "", "action": "", + "actions": "", "all": "", "an-error-occurred-while-downloading-your-document": "", "approve": "", + "are-you-sure-you-want-to-delete": "", + "cancel": "", + "created": "", "delete": "", + "document-deleted": "", + "documents": "", + "documenttitle-has-been-successfully-deleted": "", "download": "", "duplicate": "", "edit": "", + "go-back": "", + "last-updated": "", + "manage-documents": "", + "no-document-available": "", + "oops-something-went-wrong": "", + "owner": "", + "please-note-that-this-action": "", + "recipient": "", "search": "", + "sender": "", + "senderlabel": "", "share": "", "share-signing-card": "", "sign": "", "something-went-wrong": "", + "stats": "", + "status": "", + "subscriptions": "", + "the-page-you-are-looking": "", + "this-document-could-not-be-deleted-at-this-time-please-try-again": "", + "title": "", + "type-delete-to-confirm": "", + "users": "", "view": "", - "void": "", - "senderlabel": "" + "void": "" } From 6159b610e46c189125d438ea76c4a3f8e34683cb Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 13:59:00 +0000 Subject: [PATCH 03/11] fix(delete-document-dialog.tsx): change useTranslation to createTranslation feat(delete-document-dialog.tsx): update use of createTranslation to be async feat(documents-page-view.tsx): replace static text with translation for documents feat(duplicate-document-dialog.tsx): add translations for toast messages and dialog titles feat(duplicate-document-dialog.tsx): add translations for loading message and buttons feat(web.json): add translations for document-duplicated and your-document-has-been-successfully-duplicated --- .../documents/delete-document-dialog.tsx | 4 ++-- .../documents/documents-page-view.tsx | 2 +- .../documents/duplicate-document-dialog.tsx | 16 ++++++++-------- packages/lib/i18n/locales/en/web.json | 6 +++++- packages/lib/i18n/locales/fr/web.json | 6 +++++- 5 files changed, 21 insertions(+), 13 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 c1f5b691e8..211fb48d8b 100644 --- a/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx +++ b/apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx @@ -24,7 +24,7 @@ type DeleteDraftDocumentDialogProps = { documentTitle: string; }; -export const DeleteDocumentDialog = ({ +export const DeleteDocumentDialog = async ({ id, open, onOpenChange, @@ -32,7 +32,7 @@ export const DeleteDocumentDialog = ({ documentTitle, }: DeleteDraftDocumentDialogProps) => { const router = useRouter(); - const { t } = useTranslation('web'); + const { t } = await createTranslation('web'); const { toast } = useToast(); diff --git a/apps/web/src/app/(dashboard)/documents/documents-page-view.tsx b/apps/web/src/app/(dashboard)/documents/documents-page-view.tsx index 9059b8e886..26caf1aaa2 100644 --- a/apps/web/src/app/(dashboard)/documents/documents-page-view.tsx +++ b/apps/web/src/app/(dashboard)/documents/documents-page-view.tsx @@ -98,7 +98,7 @@ export const DocumentsPageView = async ({ searchParams = {}, team }: DocumentsPa )} -

Documents

+

{t('documents')}

diff --git a/apps/web/src/app/(dashboard)/documents/duplicate-document-dialog.tsx b/apps/web/src/app/(dashboard)/documents/duplicate-document-dialog.tsx index 14370cff85..f68cb6fb69 100644 --- a/apps/web/src/app/(dashboard)/documents/duplicate-document-dialog.tsx +++ b/apps/web/src/app/(dashboard)/documents/duplicate-document-dialog.tsx @@ -50,8 +50,8 @@ export const DuplicateDocumentDialog = ({ router.push(`${documentsPath}/${newId}`); toast({ - title: 'Document Duplicated', - description: 'Your document has been successfully duplicated.', + title: t('document-duplicated'), + description: t('your-document-has-been-successfully-duplicated'), duration: 5000, }); @@ -64,8 +64,8 @@ export const DuplicateDocumentDialog = ({ await duplicateDocument({ id, teamId: team?.id }); } catch { toast({ - title: 'Something went wrong', - description: 'This document could not be duplicated at this time. Please try again.', + title: t('something-went-wrong'), + description: t('this-document-could-not-be-duplicated'), variant: 'destructive', duration: 7500, }); @@ -76,12 +76,12 @@ export const DuplicateDocumentDialog = ({ !isLoading && onOpenChange(value)}> - Duplicate + {t('duplicate')} {!documentData || isLoading ? (

- Loading Document... + {t('loading-document')}

) : ( @@ -98,7 +98,7 @@ export const DuplicateDocumentDialog = ({ onClick={() => onOpenChange(false)} className="flex-1" > - Cancel + {t('cancel')}
diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 3a9156b208..ee45a470b6 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -10,6 +10,7 @@ "created": "Created", "delete": "Delete", "document-deleted": "Document deleted", + "document-duplicated": "Document Duplicated", "documents": "Documents", "documenttitle-has-been-successfully-deleted": "\"{{documentTitle}}\" has been successfully deleted", "download": "Download", @@ -17,6 +18,7 @@ "edit": "Edit", "go-back": "Go Back", "last-updated": "Last updated", + "loading-document": "Loading Document...", "manage-documents": "Manage documents", "no-document-available": "No document available", "oops-something-went-wrong": "Oops! Something went wrong.", @@ -35,9 +37,11 @@ "subscriptions": "Subscriptions", "the-page-you-are-looking": "The page you are looking for was moved, removed, renamed or might never have existed.", "this-document-could-not-be-deleted-at-this-time-please-try-again": "This document could not be deleted at this time. Please try again.", + "this-document-could-not-be-duplicated": "This document could not be duplicated at this time. Please try again.", "title": "Title", "type-delete-to-confirm": "Type 'delete' to confirm", "users": "Users", "view": "View", - "void": "Void" + "void": "Void", + "your-document-has-been-successfully-duplicated": "Your document has been successfully duplicated." } diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 3e682be9eb..3f6fb4d897 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -10,6 +10,7 @@ "created": "", "delete": "", "document-deleted": "", + "document-duplicated": "", "documents": "", "documenttitle-has-been-successfully-deleted": "", "download": "", @@ -17,6 +18,7 @@ "edit": "", "go-back": "", "last-updated": "", + "loading-document": "", "manage-documents": "", "no-document-available": "", "oops-something-went-wrong": "", @@ -35,9 +37,11 @@ "subscriptions": "", "the-page-you-are-looking": "", "this-document-could-not-be-deleted-at-this-time-please-try-again": "", + "this-document-could-not-be-duplicated": "", "title": "", "type-delete-to-confirm": "", "users": "", "view": "", - "void": "" + "void": "", + "your-document-has-been-successfully-duplicated": "" } From 91e89ee1c7f5b43ab43a5e75b30771a590d532f9 Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 14:18:25 +0000 Subject: [PATCH 04/11] fix(upload-document.tsx): update text content to use translation keys for consistency and localization feat(web.json): add new translation keys for error messages and document upload messages --- .../(dashboard)/documents/upload-document.tsx | 33 +++++++++++-------- packages/lib/i18n/locales/en/web.json | 14 +++++++- packages/lib/i18n/locales/fr/web.json | 14 +++++++- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/upload-document.tsx b/apps/web/src/app/(dashboard)/documents/upload-document.tsx index 8cbbc7b811..9516393789 100644 --- a/apps/web/src/app/(dashboard)/documents/upload-document.tsx +++ b/apps/web/src/app/(dashboard)/documents/upload-document.tsx @@ -45,12 +45,12 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => { const disabledMessage = useMemo(() => { if (remaining.documents === 0) { return team - ? 'Document upload disabled due to unpaid invoices' - : 'You have reached your document limit.'; + ? t('document-upload-disabled-due-to-unpaid-invoices') + : t('web.you-have-reached-your-document-limit'); } if (!session?.user.emailVerified) { - return 'Verify your email to upload documents.'; + return t('verify-your-email-to-upload-documents'); } }, [remaining.documents, session?.user.emailVerified, team]); @@ -72,8 +72,8 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => { }); toast({ - title: 'Document uploaded', - description: 'Your document has been uploaded successfully.', + title: t('document-uploaded'), + description: t('your-document-has-been-uploaded-successfully'), duration: 5000, }); @@ -89,14 +89,14 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => { if (error instanceof TRPCClientError) { toast({ - title: 'Error', + title: t('error'), description: error.message, variant: 'destructive', }); } else { toast({ - title: 'Error', - description: 'An error occurred while uploading your document.', + title: t('error'), + description: t('an-error-occurred-while-uploading-your-document'), variant: 'destructive', }); } @@ -107,8 +107,10 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => { const onFileDropRejected = () => { toast({ - title: 'Your document failed to upload.', - description: `File cannot be larger than ${APP_DOCUMENT_UPLOAD_SIZE_LIMIT}MB`, + title: t('your-document-failed-to-upload'), + description: t('file-cannot-be-larger-than_upload_size_limit-mb', { + size: APP_DOCUMENT_UPLOAD_SIZE_LIMIT, + }), duration: 5000, variant: 'destructive', }); @@ -129,7 +131,10 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => { remaining.documents > 0 && Number.isFinite(remaining.documents) && (

- {remaining.documents} of {quota.documents} documents remaining this month. + {t('documents-remaining-this-month', { + remaining: remaining.documents, + total: quota.documents, + })}

)}
@@ -144,18 +149,18 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => {

- You have reached your document limit. + {t('you-have-reached-your-document-limit')}

- You can upload up to {quota.documents} documents per month on your current plan. + {t('you-can-upload-up-to', { count: quota.documents })}

- Upgrade your account to upload more documents. + {t('upgrade-your-account-to-upload-more-documents')}
diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index ee45a470b6..e537c95499 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -4,6 +4,7 @@ "actions": "Actions", "all": "All", "an-error-occurred-while-downloading-your-document": "An error occurred while downloading your document.", + "an-error-occurred-while-uploading-your-document": "An error occurred while uploading your document.", "approve": "Approve", "are-you-sure-you-want-to-delete": "Are you sure you want to delete {{documentTitle}}? ", "cancel": "Cancel", @@ -11,11 +12,16 @@ "delete": "Delete", "document-deleted": "Document deleted", "document-duplicated": "Document Duplicated", + "document-upload-disabled-due-to-unpaid-invoices": "Document upload disabled due to unpaid invoices", + "document-uploaded": "Document uploaded", "documents": "Documents", + "documents-remaining-this-month": "{{remaining}} of {{total}} documents remaining this month.", "documenttitle-has-been-successfully-deleted": "\"{{documentTitle}}\" has been successfully deleted", "download": "Download", "duplicate": "Duplicate", "edit": "Edit", + "error": "Error", + "file-cannot-be-larger-than_upload_size_limit-mb": "File cannot be larger than {{size}}MB", "go-back": "Go Back", "last-updated": "Last updated", "loading-document": "Loading Document...", @@ -40,8 +46,14 @@ "this-document-could-not-be-duplicated": "This document could not be duplicated at this time. Please try again.", "title": "Title", "type-delete-to-confirm": "Type 'delete' to confirm", + "upgrade-your-account-to-upload-more-documents": "Upgrade your account to upload more documents.", "users": "Users", + "verify-your-email-to-upload-documents": "Verify your email to upload documents.", "view": "View", "void": "Void", - "your-document-has-been-successfully-duplicated": "Your document has been successfully duplicated." + "you-can-upload-up-to": "You can upload up to {{count}} documents per month on your current plan.", + "you-have-reached-your-document-limit": "You have reached your document limit.", + "your-document-failed-to-upload": "Your document failed to upload.", + "your-document-has-been-successfully-duplicated": "Your document has been successfully duplicated.", + "your-document-has-been-uploaded-successfully": "Your document has been uploaded successfully." } diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 3f6fb4d897..ca0a1793b7 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -4,6 +4,7 @@ "actions": "", "all": "", "an-error-occurred-while-downloading-your-document": "", + "an-error-occurred-while-uploading-your-document": "", "approve": "", "are-you-sure-you-want-to-delete": "", "cancel": "", @@ -11,11 +12,16 @@ "delete": "", "document-deleted": "", "document-duplicated": "", + "document-upload-disabled-due-to-unpaid-invoices": "", + "document-uploaded": "", "documents": "", + "documents-remaining-this-month": "", "documenttitle-has-been-successfully-deleted": "", "download": "", "duplicate": "", "edit": "", + "error": "", + "file-cannot-be-larger-than_upload_size_limit-mb": "", "go-back": "", "last-updated": "", "loading-document": "", @@ -40,8 +46,14 @@ "this-document-could-not-be-duplicated": "", "title": "", "type-delete-to-confirm": "", + "upgrade-your-account-to-upload-more-documents": "", "users": "", + "verify-your-email-to-upload-documents": "", "view": "", "void": "", - "your-document-has-been-successfully-duplicated": "" + "you-can-upload-up-to": "", + "you-have-reached-your-document-limit": "", + "your-document-failed-to-upload": "", + "your-document-has-been-successfully-duplicated": "", + "your-document-has-been-uploaded-successfully": "" } From 9330c463852d60517aefd377709110fb44d40405 Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 14:24:20 +0000 Subject: [PATCH 05/11] refactor(empty-state.tsx): update text content in EmptyDocumentState component to use translated strings for better internationalization feat(i18n): add English translations for new strings related to empty document states and drafts in web app feat(i18n): add French translations for new strings related to empty document states and drafts in web app --- .../app/(dashboard)/documents/empty-state.tsx | 20 ++++++++----------- packages/lib/i18n/locales/en/web.json | 7 +++++++ packages/lib/i18n/locales/fr/web.json | 7 +++++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/empty-state.tsx b/apps/web/src/app/(dashboard)/documents/empty-state.tsx index b6d2f74e2c..638acddbdb 100644 --- a/apps/web/src/app/(dashboard)/documents/empty-state.tsx +++ b/apps/web/src/app/(dashboard)/documents/empty-state.tsx @@ -12,27 +12,23 @@ export const EmptyDocumentState = ({ status }: EmptyDocumentProps) => { icon: Icon, } = match(status) .with(ExtendedDocumentStatus.COMPLETED, () => ({ - title: 'Nothing to do', - message: - 'There are no completed documents yet. Documents that you have created or received will appear here once completed.', + title: t('nothing-to-do'), + message: t('there-are-no-completed-documents'), icon: CheckCircle2, })) .with(ExtendedDocumentStatus.DRAFT, () => ({ - title: 'No active drafts', - message: - 'There are no active drafts at the current moment. You can upload a document to start drafting.', + title: t('no-active-drafts'), + message: t('there-are-no-active-drafts'), icon: CheckCircle2, })) .with(ExtendedDocumentStatus.ALL, () => ({ - title: "We're all empty", - message: - 'You have not yet created or received any documents. To create a document please upload one.', + title: t('were-all-empty'), + message: t('you-have-not-yet-created-or-received'), icon: Bird, })) .otherwise(() => ({ - title: 'Nothing to do', - message: - 'All documents have been processed. Any new documents that are sent or received will show here.', + title: t('nothing-to-do'), + message: t('all-documents-have-been-processed'), icon: CheckCircle2, })); diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index e537c95499..f6ee574c11 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -3,6 +3,7 @@ "action": "Action", "actions": "Actions", "all": "All", + "all-documents-have-been-processed": "All documents have been processed. Any new documents that are sent or received will show here.", "an-error-occurred-while-downloading-your-document": "An error occurred while downloading your document.", "an-error-occurred-while-uploading-your-document": "An error occurred while uploading your document.", "approve": "Approve", @@ -26,7 +27,9 @@ "last-updated": "Last updated", "loading-document": "Loading Document...", "manage-documents": "Manage documents", + "no-active-drafts": "No active drafts", "no-document-available": "No document available", + "nothing-to-do": "Nothing to do", "oops-something-went-wrong": "Oops! Something went wrong.", "owner": "Owner", "please-note-that-this-action": "Please note that this action is irreversible. Once confirmed, your document will be permanently deleted.", @@ -42,6 +45,8 @@ "status": "Status", "subscriptions": "Subscriptions", "the-page-you-are-looking": "The page you are looking for was moved, removed, renamed or might never have existed.", + "there-are-no-active-drafts": "There are no active drafts at the current moment. You can upload a document to start drafting.", + "there-are-no-completed-documents": "There are no completed documents yet. Documents that you have created or received will appear here once completed.", "this-document-could-not-be-deleted-at-this-time-please-try-again": "This document could not be deleted at this time. Please try again.", "this-document-could-not-be-duplicated": "This document could not be duplicated at this time. Please try again.", "title": "Title", @@ -51,7 +56,9 @@ "verify-your-email-to-upload-documents": "Verify your email to upload documents.", "view": "View", "void": "Void", + "were-all-empty": "We're all empty", "you-can-upload-up-to": "You can upload up to {{count}} documents per month on your current plan.", + "you-have-not-yet-created-or-received": "You have not yet created or received any documents. To create a document please upload one.", "you-have-reached-your-document-limit": "You have reached your document limit.", "your-document-failed-to-upload": "Your document failed to upload.", "your-document-has-been-successfully-duplicated": "Your document has been successfully duplicated.", diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index ca0a1793b7..8b281bc58d 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -3,6 +3,7 @@ "action": "", "actions": "", "all": "", + "all-documents-have-been-processed": "", "an-error-occurred-while-downloading-your-document": "", "an-error-occurred-while-uploading-your-document": "", "approve": "", @@ -26,7 +27,9 @@ "last-updated": "", "loading-document": "", "manage-documents": "", + "no-active-drafts": "", "no-document-available": "", + "nothing-to-do": "", "oops-something-went-wrong": "", "owner": "", "please-note-that-this-action": "", @@ -42,6 +45,8 @@ "status": "", "subscriptions": "", "the-page-you-are-looking": "", + "there-are-no-active-drafts": "", + "there-are-no-completed-documents": "", "this-document-could-not-be-deleted-at-this-time-please-try-again": "", "this-document-could-not-be-duplicated": "", "title": "", @@ -51,7 +56,9 @@ "verify-your-email-to-upload-documents": "", "view": "", "void": "", + "were-all-empty": "", "you-can-upload-up-to": "", + "you-have-not-yet-created-or-received": "", "you-have-reached-your-document-limit": "", "your-document-failed-to-upload": "", "your-document-has-been-successfully-duplicated": "", From 5c39245f7385367dda71290335c7573aaa53563f Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 14:26:56 +0000 Subject: [PATCH 06/11] fix(web): update text in DashboardSettingsLayout to use translation key for 'settings' fix(web): update text in ProfileSettingsPage to use translation keys for 'profile' and 'here-you-can-edit-your-personal-details' feat(i18n): add translation keys for 'profile' and 'settings' in English and French locales --- apps/web/src/app/(dashboard)/settings/layout.tsx | 2 +- apps/web/src/app/(dashboard)/settings/profile/page.tsx | 5 ++++- packages/lib/i18n/locales/en/web.json | 3 +++ packages/lib/i18n/locales/fr/web.json | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/layout.tsx b/apps/web/src/app/(dashboard)/settings/layout.tsx index f682de2423..dfd82b9d77 100644 --- a/apps/web/src/app/(dashboard)/settings/layout.tsx +++ b/apps/web/src/app/(dashboard)/settings/layout.tsx @@ -10,7 +10,7 @@ export type DashboardSettingsLayoutProps = { export default function DashboardSettingsLayout({ children }: DashboardSettingsLayoutProps) { return (
-

Settings

+

{t('settings')}

diff --git a/apps/web/src/app/(dashboard)/settings/profile/page.tsx b/apps/web/src/app/(dashboard)/settings/profile/page.tsx index 2890eb5d58..53e9c5c793 100644 --- a/apps/web/src/app/(dashboard)/settings/profile/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/profile/page.tsx @@ -14,7 +14,10 @@ export default async function ProfileSettingsPage() { return (
- +
diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index f6ee574c11..64d9801faa 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -24,6 +24,7 @@ "error": "Error", "file-cannot-be-larger-than_upload_size_limit-mb": "File cannot be larger than {{size}}MB", "go-back": "Go Back", + "here-you-can-edit-your-personal-details": "Here you can edit your personal details.", "last-updated": "Last updated", "loading-document": "Loading Document...", "manage-documents": "Manage documents", @@ -33,10 +34,12 @@ "oops-something-went-wrong": "Oops! Something went wrong.", "owner": "Owner", "please-note-that-this-action": "Please note that this action is irreversible. Once confirmed, your document will be permanently deleted.", + "profile": "Profile", "recipient": "Recipient", "search": "Search", "sender": "Sender", "senderlabel": "Sender:", + "settings": "Settings", "share": "Share", "share-signing-card": "Share Signing Card", "sign": "Sign", diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 8b281bc58d..844c3b1551 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -24,6 +24,7 @@ "error": "", "file-cannot-be-larger-than_upload_size_limit-mb": "", "go-back": "", + "here-you-can-edit-your-personal-details": "", "last-updated": "", "loading-document": "", "manage-documents": "", @@ -33,10 +34,12 @@ "oops-something-went-wrong": "", "owner": "", "please-note-that-this-action": "", + "profile": "", "recipient": "", "search": "", "sender": "", "senderlabel": "", + "settings": "", "share": "", "share-signing-card": "", "sign": "", From c9c4c7e1492d72d471841203ac99637ebc2c583f Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 14:48:39 +0000 Subject: [PATCH 07/11] fix(page.tsx): update title and subtitle text to use translation keys for better internationalization support feat(page.tsx): add translation keys for two-factor authentication, recovery codes, recent activity, and view activity for better localization feat(web.json): add translation keys for new strings related to security settings page and update existing translation keys for better internationalization support --- .../(dashboard)/settings/security/page.tsx | 31 +++++++++---------- packages/lib/i18n/locales/en/web.json | 11 +++++++ packages/lib/i18n/locales/fr/web.json | 11 +++++++ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/security/page.tsx b/apps/web/src/app/(dashboard)/settings/security/page.tsx index f46784aed0..c32b9c1e21 100644 --- a/apps/web/src/app/(dashboard)/settings/security/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/security/page.tsx @@ -21,8 +21,8 @@ export default async function SecuritySettingsPage() { return (
{user.identityProvider === 'DOCUMENSO' ? ( @@ -36,12 +36,9 @@ export default async function SecuritySettingsPage() { variant="neutral" >
- Two factor authentication + {t('two-factor-authentication')} - - Create one-time passwords that serve as a secondary authentication method for - confirming your identity when requested during the sign-in process. - + {t('create-one-time-passwords')}
@@ -53,11 +50,10 @@ export default async function SecuritySettingsPage() { variant="neutral" >
- Recovery codes + {t('recovery-codes')} - Two factor authentication recovery codes are used to access your account in the - event that you lose access to your authenticator app. + {t('two-factor-authentication-recovery')}
@@ -68,13 +64,14 @@ export default async function SecuritySettingsPage() { ) : ( - Your account is managed by {IDENTITY_PROVIDER_NAME[user.identityProvider]} + {t('your-account-is-managed-by')} {IDENTITY_PROVIDER_NAME[user.identityProvider]} - To update your password, enable two-factor authentication, and manage other security - settings, please go to your {IDENTITY_PROVIDER_NAME[user.identityProvider]} account - settings. + { + (t('to-update-your-password'), + { provider: IDENTITY_PROVIDER_NAME[user.identityProvider] }) + } )} @@ -84,15 +81,15 @@ export default async function SecuritySettingsPage() { variant="neutral" >
- Recent activity + {t('recent-activity')} - View all recent security activity related to your account. + {t('view-all-recent-security-activity-related-to-your-account')}
diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 64d9801faa..80e9d03192 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -9,6 +9,7 @@ "approve": "Approve", "are-you-sure-you-want-to-delete": "Are you sure you want to delete {{documentTitle}}? ", "cancel": "Cancel", + "create-one-time-passwords": "Create one-time passwords that serve as a secondary authentication method for confirming your identity when requested during the sign-in process.", "created": "Created", "delete": "Delete", "document-deleted": "Document deleted", @@ -25,6 +26,7 @@ "file-cannot-be-larger-than_upload_size_limit-mb": "File cannot be larger than {{size}}MB", "go-back": "Go Back", "here-you-can-edit-your-personal-details": "Here you can edit your personal details.", + "here-you-can-manage-your-password-and-security-settings": "Here you can manage your password and security settings.", "last-updated": "Last updated", "loading-document": "Loading Document...", "manage-documents": "Manage documents", @@ -35,8 +37,11 @@ "owner": "Owner", "please-note-that-this-action": "Please note that this action is irreversible. Once confirmed, your document will be permanently deleted.", "profile": "Profile", + "recent-activity": "Recent activity", "recipient": "Recipient", + "recovery-codes": "Recovery codes", "search": "Search", + "security": "Security", "sender": "Sender", "senderlabel": "Sender:", "settings": "Settings", @@ -53,16 +58,22 @@ "this-document-could-not-be-deleted-at-this-time-please-try-again": "This document could not be deleted at this time. Please try again.", "this-document-could-not-be-duplicated": "This document could not be duplicated at this time. Please try again.", "title": "Title", + "to-update-your-password": "To update your password, enable two-factor authentication, and manage other security settings, please go to your {{provider}} account settings.", + "two-factor-authentication": "Two factor authentication", + "two-factor-authentication-recovery": "Two factor authentication recovery codes are used to access your account in the event that you lose access to your authenticator app.", "type-delete-to-confirm": "Type 'delete' to confirm", "upgrade-your-account-to-upload-more-documents": "Upgrade your account to upload more documents.", "users": "Users", "verify-your-email-to-upload-documents": "Verify your email to upload documents.", "view": "View", + "view-activity": "View activity", + "view-all-recent-security-activity-related-to-your-account": "View all recent security activity related to your account.", "void": "Void", "were-all-empty": "We're all empty", "you-can-upload-up-to": "You can upload up to {{count}} documents per month on your current plan.", "you-have-not-yet-created-or-received": "You have not yet created or received any documents. To create a document please upload one.", "you-have-reached-your-document-limit": "You have reached your document limit.", + "your-account-is-managed-by": "Your account is managed by", "your-document-failed-to-upload": "Your document failed to upload.", "your-document-has-been-successfully-duplicated": "Your document has been successfully duplicated.", "your-document-has-been-uploaded-successfully": "Your document has been uploaded successfully." diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 844c3b1551..1e04717dc3 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -9,6 +9,7 @@ "approve": "", "are-you-sure-you-want-to-delete": "", "cancel": "", + "create-one-time-passwords": "", "created": "", "delete": "", "document-deleted": "", @@ -25,6 +26,7 @@ "file-cannot-be-larger-than_upload_size_limit-mb": "", "go-back": "", "here-you-can-edit-your-personal-details": "", + "here-you-can-manage-your-password-and-security-settings": "", "last-updated": "", "loading-document": "", "manage-documents": "", @@ -35,8 +37,11 @@ "owner": "", "please-note-that-this-action": "", "profile": "", + "recent-activity": "", "recipient": "", + "recovery-codes": "", "search": "", + "security": "", "sender": "", "senderlabel": "", "settings": "", @@ -53,16 +58,22 @@ "this-document-could-not-be-deleted-at-this-time-please-try-again": "", "this-document-could-not-be-duplicated": "", "title": "", + "to-update-your-password": "", + "two-factor-authentication": "", + "two-factor-authentication-recovery": "", "type-delete-to-confirm": "", "upgrade-your-account-to-upload-more-documents": "", "users": "", "verify-your-email-to-upload-documents": "", "view": "", + "view-activity": "", + "view-all-recent-security-activity-related-to-your-account": "", "void": "", "were-all-empty": "", "you-can-upload-up-to": "", "you-have-not-yet-created-or-received": "", "you-have-reached-your-document-limit": "", + "your-account-is-managed-by": "", "your-document-failed-to-upload": "", "your-document-has-been-successfully-duplicated": "", "your-document-has-been-uploaded-successfully": "" From d8c53413b12705a52438cd3eb5bed12ba4e400be Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 14:51:59 +0000 Subject: [PATCH 08/11] refactor(security): update text in security activity page and data table to use i18n keys for better localization support feat(i18n): add translations for 'date', 'device', 'browser', 'ip-address', and 'action' in English and French feat(security): introduce i18n key 'security-activity' for the security activity title in English and French --- .../(dashboard)/settings/security/activity/page.tsx | 4 ++-- .../activity/user-security-activity-data-table.tsx | 10 +++++----- packages/lib/i18n/locales/en/web.json | 5 +++++ packages/lib/i18n/locales/fr/web.json | 5 +++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/security/activity/page.tsx b/apps/web/src/app/(dashboard)/settings/security/activity/page.tsx index 6e183b0c72..415145eb88 100644 --- a/apps/web/src/app/(dashboard)/settings/security/activity/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/security/activity/page.tsx @@ -9,10 +9,10 @@ export const metadata: Metadata = { export default function SettingsSecurityActivityPage() { return (
-

Security activity

+

{t('security-activity')}

- View all recent security activity related to your account. + {t('view-all-recent-security-activity-related-to-your-account')}


diff --git a/apps/web/src/app/(dashboard)/settings/security/activity/user-security-activity-data-table.tsx b/apps/web/src/app/(dashboard)/settings/security/activity/user-security-activity-data-table.tsx index 4937749fcc..f3c3f3eb4a 100644 --- a/apps/web/src/app/(dashboard)/settings/security/activity/user-security-activity-data-table.tsx +++ b/apps/web/src/app/(dashboard)/settings/security/activity/user-security-activity-data-table.tsx @@ -63,12 +63,12 @@ export const UserSecurityActivityDataTable = () => { , }, { - header: 'Device', + header: t('device'), cell: ({ row }) => { if (!row.original.userAgent) { return 'N/A'; @@ -92,7 +92,7 @@ export const UserSecurityActivityDataTable = () => { }, }, { - header: 'Browser', + header: t('browser'), cell: ({ row }) => { if (!row.original.userAgent) { return 'N/A'; @@ -106,12 +106,12 @@ export const UserSecurityActivityDataTable = () => { }, }, { - header: 'IP Address', + header: t('ip-address'), accessorKey: 'ipAddress', cell: ({ row }) => row.original.ipAddress ?? 'N/A', }, { - header: 'Action', + header: t('action'), accessorKey: 'type', cell: ({ row }) => USER_SECURITY_AUDIT_LOG_MAP[row.original.type], }, diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 80e9d03192..f9e4bc3c0f 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -8,10 +8,13 @@ "an-error-occurred-while-uploading-your-document": "An error occurred while uploading your document.", "approve": "Approve", "are-you-sure-you-want-to-delete": "Are you sure you want to delete {{documentTitle}}? ", + "browser": "Browser", "cancel": "Cancel", "create-one-time-passwords": "Create one-time passwords that serve as a secondary authentication method for confirming your identity when requested during the sign-in process.", "created": "Created", + "date": "Date", "delete": "Delete", + "device": "Device", "document-deleted": "Document deleted", "document-duplicated": "Document Duplicated", "document-upload-disabled-due-to-unpaid-invoices": "Document upload disabled due to unpaid invoices", @@ -27,6 +30,7 @@ "go-back": "Go Back", "here-you-can-edit-your-personal-details": "Here you can edit your personal details.", "here-you-can-manage-your-password-and-security-settings": "Here you can manage your password and security settings.", + "ip-address": "IP Address", "last-updated": "Last updated", "loading-document": "Loading Document...", "manage-documents": "Manage documents", @@ -42,6 +46,7 @@ "recovery-codes": "Recovery codes", "search": "Search", "security": "Security", + "security-activity": "Security activity", "sender": "Sender", "senderlabel": "Sender:", "settings": "Settings", diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 1e04717dc3..6a54a6f24c 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -8,10 +8,13 @@ "an-error-occurred-while-uploading-your-document": "", "approve": "", "are-you-sure-you-want-to-delete": "", + "browser": "", "cancel": "", "create-one-time-passwords": "", "created": "", + "date": "", "delete": "", + "device": "", "document-deleted": "", "document-duplicated": "", "document-upload-disabled-due-to-unpaid-invoices": "", @@ -27,6 +30,7 @@ "go-back": "", "here-you-can-edit-your-personal-details": "", "here-you-can-manage-your-password-and-security-settings": "", + "ip-address": "", "last-updated": "", "loading-document": "", "manage-documents": "", @@ -42,6 +46,7 @@ "recovery-codes": "", "search": "", "security": "", + "security-activity": "", "sender": "", "senderlabel": "", "settings": "", From 3047b3ba35197ac430bc0b29949cddcddaeda105 Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 14:59:02 +0000 Subject: [PATCH 09/11] fix(page.tsx): add translation for 'teams' and 'manage-all-teams-you-are-currently-associated-with' to support internationalization --- apps/web/src/app/(dashboard)/settings/teams/page.tsx | 5 +++-- packages/lib/i18n/locales/en/web.json | 2 ++ packages/lib/i18n/locales/fr/web.json | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/teams/page.tsx b/apps/web/src/app/(dashboard)/settings/teams/page.tsx index 1a3d90b661..0452fb7978 100644 --- a/apps/web/src/app/(dashboard)/settings/teams/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/teams/page.tsx @@ -14,10 +14,11 @@ import { TeamInvitations } from './team-invitations'; export default function TeamsSettingsPage() { const { data: teamEmail } = trpc.team.getTeamEmailByEmail.useQuery(); - + const { t } = useTranslation('web'); + return (
- + diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index f9e4bc3c0f..272a01ae4a 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -33,6 +33,7 @@ "ip-address": "IP Address", "last-updated": "Last updated", "loading-document": "Loading Document...", + "manage-all-teams-you-are-currently-associated-with": "Manage all teams you are currently associated with.", "manage-documents": "Manage documents", "no-active-drafts": "No active drafts", "no-document-available": "No document available", @@ -57,6 +58,7 @@ "stats": "Stats", "status": "Status", "subscriptions": "Subscriptions", + "teams": "Teams", "the-page-you-are-looking": "The page you are looking for was moved, removed, renamed or might never have existed.", "there-are-no-active-drafts": "There are no active drafts at the current moment. You can upload a document to start drafting.", "there-are-no-completed-documents": "There are no completed documents yet. Documents that you have created or received will appear here once completed.", diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index 6a54a6f24c..e0c42ab74b 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -33,6 +33,7 @@ "ip-address": "", "last-updated": "", "loading-document": "", + "manage-all-teams-you-are-currently-associated-with": "", "manage-documents": "", "no-active-drafts": "", "no-document-available": "", @@ -57,6 +58,7 @@ "stats": "", "status": "", "subscriptions": "", + "teams": "", "the-page-you-are-looking": "", "there-are-no-active-drafts": "", "there-are-no-completed-documents": "", From d2c98522f532bce88f0f52cb630faaba862bfb79 Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 15:02:17 +0000 Subject: [PATCH 10/11] refactor(page.tsx): improve readability by formatting SettingsHeader component feat(page.tsx): add support for translation in TeamEmailUsage component feat(web.json): add translation keys for team email usage messages and actions --- .../app/(dashboard)/settings/teams/page.tsx | 5 ++- .../settings/teams/team-email-usage.tsx | 34 +++++++++---------- packages/lib/i18n/locales/en/web.json | 15 +++++++- packages/lib/i18n/locales/fr/web.json | 15 +++++++- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/teams/page.tsx b/apps/web/src/app/(dashboard)/settings/teams/page.tsx index 0452fb7978..0361a3f366 100644 --- a/apps/web/src/app/(dashboard)/settings/teams/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/teams/page.tsx @@ -18,7 +18,10 @@ export default function TeamsSettingsPage() { return (
- + diff --git a/apps/web/src/app/(dashboard)/settings/teams/team-email-usage.tsx b/apps/web/src/app/(dashboard)/settings/teams/team-email-usage.tsx index 56a7b110a1..83d98f09f7 100644 --- a/apps/web/src/app/(dashboard)/settings/teams/team-email-usage.tsx +++ b/apps/web/src/app/(dashboard)/settings/teams/team-email-usage.tsx @@ -23,25 +23,24 @@ export type TeamEmailUsageProps = { export const TeamEmailUsage = ({ teamEmail }: TeamEmailUsageProps) => { const [open, setOpen] = useState(false); - + const { t } = useTranslation('web'); const { toast } = useToast(); const { mutateAsync: deleteTeamEmail, isLoading: isDeletingTeamEmail } = trpc.team.deleteTeamEmail.useMutation({ onSuccess: () => { toast({ - title: 'Success', - description: 'You have successfully revoked access.', + title: t('success'), + description: t('you-have-successfully-revoked-access'), duration: 5000, }); }, onError: () => { toast({ - title: 'Something went wrong', + title: t('something-went-wrong'), variant: 'destructive', duration: 10000, - description: - 'We encountered an unknown error while attempting to revoke access. Please try again or contact support.', + description: t('we-encountered-an-unknown-error-while-revoking'), }); }, }); @@ -49,43 +48,42 @@ export const TeamEmailUsage = ({ teamEmail }: TeamEmailUsageProps) => { return (
- Team Email + {t('team-email')}

- Your email is currently being used by team{' '} + {t('your-email-is-currently-being-used-by-team')}{' '} {teamEmail.team.name} ({teamEmail.team.url} ).

-

They have permission on your behalf to:

+

{t('they-have-permission-on-your-behalf-to')}

    -
  • Display your name and email in documents
  • -
  • View all documents sent to your account
  • +
  • {t('display-your-name-and-email-in-documents')}
  • +
  • {t('view-all-documents-sent-to-your-account')}
!isDeletingTeamEmail && setOpen(value)}> - + - Are you sure? + {t('are-you-sure')} - You are about to revoke access for team{' '} - {teamEmail.team.name} ({teamEmail.team.url}) to - use your email. + {t('you-are-about-to-revoke-access-for-team')}{' '} + {teamEmail.team.name} ({teamEmail.team.url}{t('to-use-your-email')}
diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 272a01ae4a..1e5357898f 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -7,6 +7,7 @@ "an-error-occurred-while-downloading-your-document": "An error occurred while downloading your document.", "an-error-occurred-while-uploading-your-document": "An error occurred while uploading your document.", "approve": "Approve", + "are-you-sure": "Are you sure?", "are-you-sure-you-want-to-delete": "Are you sure you want to delete {{documentTitle}}? ", "browser": "Browser", "cancel": "Cancel", @@ -15,6 +16,7 @@ "date": "Date", "delete": "Delete", "device": "Device", + "display-your-name-and-email-in-documents": "Display your name and email in documents", "document-deleted": "Document deleted", "document-duplicated": "Document Duplicated", "document-upload-disabled-due-to-unpaid-invoices": "Document upload disabled due to unpaid invoices", @@ -45,6 +47,8 @@ "recent-activity": "Recent activity", "recipient": "Recipient", "recovery-codes": "Recovery codes", + "revoke": "Revoke", + "revoke-access": "Revoke access", "search": "Search", "security": "Security", "security-activity": "Security activity", @@ -58,14 +62,18 @@ "stats": "Stats", "status": "Status", "subscriptions": "Subscriptions", + "success": "Success", + "team-email": "Team Email", "teams": "Teams", "the-page-you-are-looking": "The page you are looking for was moved, removed, renamed or might never have existed.", "there-are-no-active-drafts": "There are no active drafts at the current moment. You can upload a document to start drafting.", "there-are-no-completed-documents": "There are no completed documents yet. Documents that you have created or received will appear here once completed.", + "they-have-permission-on-your-behalf-to": "They have permission on your behalf to:", "this-document-could-not-be-deleted-at-this-time-please-try-again": "This document could not be deleted at this time. Please try again.", "this-document-could-not-be-duplicated": "This document could not be duplicated at this time. Please try again.", "title": "Title", "to-update-your-password": "To update your password, enable two-factor authentication, and manage other security settings, please go to your {{provider}} account settings.", + "to-use-your-email": ") to use your email.", "two-factor-authentication": "Two factor authentication", "two-factor-authentication-recovery": "Two factor authentication recovery codes are used to access your account in the event that you lose access to your authenticator app.", "type-delete-to-confirm": "Type 'delete' to confirm", @@ -74,14 +82,19 @@ "verify-your-email-to-upload-documents": "Verify your email to upload documents.", "view": "View", "view-activity": "View activity", + "view-all-documents-sent-to-your-account": "View all documents sent to your account", "view-all-recent-security-activity-related-to-your-account": "View all recent security activity related to your account.", "void": "Void", + "we-encountered-an-unknown-error-while-revoking": "We encountered an unknown error while attempting to revoke access. Please try again or contact support.", "were-all-empty": "We're all empty", + "you-are-about-to-revoke-access-for-team": "You are about to revoke access for team", "you-can-upload-up-to": "You can upload up to {{count}} documents per month on your current plan.", "you-have-not-yet-created-or-received": "You have not yet created or received any documents. To create a document please upload one.", "you-have-reached-your-document-limit": "You have reached your document limit.", + "you-have-successfully-revoked-access": "You have successfully revoked access.", "your-account-is-managed-by": "Your account is managed by", "your-document-failed-to-upload": "Your document failed to upload.", "your-document-has-been-successfully-duplicated": "Your document has been successfully duplicated.", - "your-document-has-been-uploaded-successfully": "Your document has been uploaded successfully." + "your-document-has-been-uploaded-successfully": "Your document has been uploaded successfully.", + "your-email-is-currently-being-used-by-team": "Your email is currently being used by team" } diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index e0c42ab74b..f0b904fc1a 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -7,6 +7,7 @@ "an-error-occurred-while-downloading-your-document": "", "an-error-occurred-while-uploading-your-document": "", "approve": "", + "are-you-sure": "", "are-you-sure-you-want-to-delete": "", "browser": "", "cancel": "", @@ -15,6 +16,7 @@ "date": "", "delete": "", "device": "", + "display-your-name-and-email-in-documents": "", "document-deleted": "", "document-duplicated": "", "document-upload-disabled-due-to-unpaid-invoices": "", @@ -45,6 +47,8 @@ "recent-activity": "", "recipient": "", "recovery-codes": "", + "revoke": "", + "revoke-access": "", "search": "", "security": "", "security-activity": "", @@ -58,14 +62,18 @@ "stats": "", "status": "", "subscriptions": "", + "success": "", + "team-email": "", "teams": "", "the-page-you-are-looking": "", "there-are-no-active-drafts": "", "there-are-no-completed-documents": "", + "they-have-permission-on-your-behalf-to": "", "this-document-could-not-be-deleted-at-this-time-please-try-again": "", "this-document-could-not-be-duplicated": "", "title": "", "to-update-your-password": "", + "to-use-your-email": "", "two-factor-authentication": "", "two-factor-authentication-recovery": "", "type-delete-to-confirm": "", @@ -74,14 +82,19 @@ "verify-your-email-to-upload-documents": "", "view": "", "view-activity": "", + "view-all-documents-sent-to-your-account": "", "view-all-recent-security-activity-related-to-your-account": "", "void": "", + "we-encountered-an-unknown-error-while-revoking": "", "were-all-empty": "", + "you-are-about-to-revoke-access-for-team": "", "you-can-upload-up-to": "", "you-have-not-yet-created-or-received": "", "you-have-reached-your-document-limit": "", + "you-have-successfully-revoked-access": "", "your-account-is-managed-by": "", "your-document-failed-to-upload": "", "your-document-has-been-successfully-duplicated": "", - "your-document-has-been-uploaded-successfully": "" + "your-document-has-been-uploaded-successfully": "", + "your-email-is-currently-being-used-by-team": "" } From d632bd7ee621dace78d72ea33f24ff0e2fa4415e Mon Sep 17 00:00:00 2001 From: serge Date: Thu, 22 Feb 2024 15:05:31 +0000 Subject: [PATCH 11/11] fix(accept-team-invitation-button.tsx): add useTranslation hook to support internationalization for success and error messages feat(accept-team-invitation-button.tsx): update success and error messages to be translated using the t function from useTranslation hook feat(page.tsx): remove unnecessary whitespace feat(team-email-usage.tsx): add translation for the message about revoking access for a team feat(web.json): add translations for 'accept' and 'accepted-team-invitation' feat(web.json): add translation for 'unable-to-join-this-team-at-this-time' --- .../settings/teams/accept-team-invitation-button.tsx | 12 ++++++------ apps/web/src/app/(dashboard)/settings/teams/page.tsx | 2 +- .../(dashboard)/settings/teams/team-email-usage.tsx | 3 ++- packages/lib/i18n/locales/en/web.json | 3 +++ packages/lib/i18n/locales/fr/web.json | 3 +++ 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/teams/accept-team-invitation-button.tsx b/apps/web/src/app/(dashboard)/settings/teams/accept-team-invitation-button.tsx index 8aa81653dc..65f8277d6c 100644 --- a/apps/web/src/app/(dashboard)/settings/teams/accept-team-invitation-button.tsx +++ b/apps/web/src/app/(dashboard)/settings/teams/accept-team-invitation-button.tsx @@ -10,7 +10,7 @@ export type AcceptTeamInvitationButtonProps = { export const AcceptTeamInvitationButton = ({ teamId }: AcceptTeamInvitationButtonProps) => { const { toast } = useToast(); - + const { t } = useTranslation('web'); const { mutateAsync: acceptTeamInvitation, isLoading, @@ -18,17 +18,17 @@ export const AcceptTeamInvitationButton = ({ teamId }: AcceptTeamInvitationButto } = trpc.team.acceptTeamInvitation.useMutation({ onSuccess: () => { toast({ - title: 'Success', - description: 'Accepted team invitation', + title: t('success'), + description: t('accepted-team-invitation'), duration: 5000, }); }, onError: () => { toast({ - title: 'Something went wrong', + title: t('something-went-wrong'), variant: 'destructive', duration: 10000, - description: 'Unable to join this team at this time.', + description: t('unable-to-join-this-team-at-this-time'), }); }, }); @@ -39,7 +39,7 @@ export const AcceptTeamInvitationButton = ({ teamId }: AcceptTeamInvitationButto loading={isLoading} disabled={isLoading || isSuccess} > - Accept + {t('accept')} ); }; diff --git a/apps/web/src/app/(dashboard)/settings/teams/page.tsx b/apps/web/src/app/(dashboard)/settings/teams/page.tsx index 0361a3f366..412cfc8135 100644 --- a/apps/web/src/app/(dashboard)/settings/teams/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/teams/page.tsx @@ -15,7 +15,7 @@ import { TeamInvitations } from './team-invitations'; export default function TeamsSettingsPage() { const { data: teamEmail } = trpc.team.getTeamEmailByEmail.useQuery(); const { t } = useTranslation('web'); - + return (
{ {t('you-are-about-to-revoke-access-for-team')}{' '} - {teamEmail.team.name} ({teamEmail.team.url}{t('to-use-your-email')} + {teamEmail.team.name} ({teamEmail.team.url} + {t('to-use-your-email')} diff --git a/packages/lib/i18n/locales/en/web.json b/packages/lib/i18n/locales/en/web.json index 1e5357898f..33406edfa4 100644 --- a/packages/lib/i18n/locales/en/web.json +++ b/packages/lib/i18n/locales/en/web.json @@ -1,5 +1,7 @@ { "404-page-not-found": "404 Page not found", + "accept": "Accept", + "accepted-team-invitation": "Accepted team invitation", "action": "Action", "actions": "Actions", "all": "All", @@ -77,6 +79,7 @@ "two-factor-authentication": "Two factor authentication", "two-factor-authentication-recovery": "Two factor authentication recovery codes are used to access your account in the event that you lose access to your authenticator app.", "type-delete-to-confirm": "Type 'delete' to confirm", + "unable-to-join-this-team-at-this-time": "Unable to join this team at this time.", "upgrade-your-account-to-upload-more-documents": "Upgrade your account to upload more documents.", "users": "Users", "verify-your-email-to-upload-documents": "Verify your email to upload documents.", diff --git a/packages/lib/i18n/locales/fr/web.json b/packages/lib/i18n/locales/fr/web.json index f0b904fc1a..2cd3f2e2cf 100644 --- a/packages/lib/i18n/locales/fr/web.json +++ b/packages/lib/i18n/locales/fr/web.json @@ -1,5 +1,7 @@ { "404-page-not-found": "", + "accept": "", + "accepted-team-invitation": "", "action": "", "actions": "", "all": "", @@ -77,6 +79,7 @@ "two-factor-authentication": "", "two-factor-authentication-recovery": "", "type-delete-to-confirm": "", + "unable-to-join-this-team-at-this-time": "", "upgrade-your-account-to-upload-more-documents": "", "users": "", "verify-your-email-to-upload-documents": "",