feat: i18n for emails (#1442)

## Description

Support setting a document language that will control the language used
for sending emails to recipients. Additional work has been done to
convert all emails to using our i18n implementation so we can later add
controls for sending other kinds of emails in a users target language.

## Related Issue

N/A

## Changes Made

- Added `<Trans>` and `msg` macros to emails
- Introduced a new `renderEmailWithI18N` utility in the lib package
- Updated all emails to use the `<Tailwind>` component at the top level
due to rendering constraints
- Updated the `i18n.server.tsx` file to not use a top level await

## Testing Performed

- Configured document language and verified emails were sent in the
expected language
- Created a document from a template and verified that the templates
language was transferred to the document
This commit is contained in:
Lucas Smith
2024-11-05 11:52:54 +11:00
committed by GitHub
parent 04b1ce1aab
commit 4dd95016b1
163 changed files with 3549 additions and 1461 deletions

View File

@ -260,12 +260,12 @@ msgstr "Abonnements actifs"
msgid "Add"
msgstr "Ajouter"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:175
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:87
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:176
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:88
msgid "Add all relevant fields for each recipient."
msgstr "Ajouter tous les champs pertinents pour chaque destinataire."
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:82
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:83
msgid "Add all relevant placeholders for each recipient."
msgstr "Ajouter tous les espaces réservés pertinents pour chaque destinataire."
@ -281,8 +281,8 @@ msgstr "Ajouter un authentificateur pour servir de méthode d'authentification s
msgid "Add email"
msgstr "Ajouter un e-mail"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:174
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:86
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:175
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:87
msgid "Add Fields"
msgstr "Ajouter des champs"
@ -295,15 +295,15 @@ msgstr "Ajouter davantage"
msgid "Add passkey"
msgstr "Ajouter une clé de passe"
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:81
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:82
msgid "Add Placeholders"
msgstr "Ajouter des espaces réservés"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:169
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:170
msgid "Add Signers"
msgstr "Ajouter des signataires"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:179
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:180
msgid "Add Subject"
msgstr "Ajouter un sujet"
@ -311,7 +311,7 @@ msgstr "Ajouter un sujet"
msgid "Add team email"
msgstr "Ajouter un e-mail d'équipe"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:170
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:171
msgid "Add the people who will sign the document."
msgstr "Ajouter les personnes qui signeront le document."
@ -319,7 +319,7 @@ msgstr "Ajouter les personnes qui signeront le document."
msgid "Add the recipients to create the document with"
msgstr "Ajouter les destinataires pour créer le document avec"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:180
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:181
msgid "Add the subject and message you wish to send to signers."
msgstr "Ajouter le sujet et le message que vous souhaitez envoyer aux signataires."
@ -414,13 +414,13 @@ msgstr "Un e-mail demandant le transfert de cette équipe a été envoyé."
msgid "An error occurred"
msgstr "Une erreur est survenue"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:266
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:197
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:231
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:268
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:201
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:235
msgid "An error occurred while adding signers."
msgstr "Une erreur est survenue lors de l'ajout de signataires."
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:301
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:303
msgid "An error occurred while adding the fields."
msgstr "Une erreur est survenue lors de l'ajout des champs."
@ -482,7 +482,7 @@ msgstr "Une erreur est survenue lors de la suppression de la signature."
msgid "An error occurred while removing the text."
msgstr "Une erreur est survenue lors de la suppression du texte."
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:332
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:334
msgid "An error occurred while sending the document."
msgstr "Une erreur est survenue lors de l'envoi du document."
@ -507,8 +507,8 @@ msgstr "Une erreur est survenue lors de la signature du document."
msgid "An error occurred while trying to create a checkout session."
msgstr "Une erreur est survenue lors de la création d'une session de paiement."
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:232
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:166
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:234
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:170
msgid "An error occurred while updating the document settings."
msgstr "Une erreur est survenue lors de la mise à jour des paramètres du document."
@ -869,11 +869,11 @@ msgstr "Documents complétés"
msgid "Completed Documents"
msgstr "Documents Complétés"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:165
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:166
msgid "Configure general settings for the document."
msgstr "Configurer les paramètres généraux pour le document."
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:77
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:78
msgid "Configure general settings for the template."
msgstr "Configurer les paramètres généraux pour le modèle."
@ -1350,7 +1350,7 @@ msgstr "Document renvoyé"
msgid "Document resealed"
msgstr "Document resealé"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:321
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:323
msgid "Document sent"
msgstr "Document envoyé"
@ -1579,16 +1579,16 @@ msgstr "Entrez votre texte ici"
#: apps/web/src/app/(dashboard)/admin/documents/[id]/admin-actions.tsx:41
#: apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx:78
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:231
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:265
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:300
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:331
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:233
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:267
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:302
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:333
#: apps/web/src/app/(dashboard)/documents/move-document-dialog.tsx:57
#: apps/web/src/app/(dashboard)/documents/upload-document.tsx:106
#: apps/web/src/app/(dashboard)/documents/upload-document.tsx:112
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:165
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:196
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:230
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:169
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:200
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:234
#: apps/web/src/app/(dashboard)/templates/duplicate-template-dialog.tsx:51
#: apps/web/src/app/(dashboard)/templates/move-template-dialog.tsx:56
#: apps/web/src/app/(dashboard)/templates/use-template-dialog.tsx:160
@ -1679,8 +1679,8 @@ msgstr "Mot de passe oublié ?"
msgid "Full Name"
msgstr "Nom complet"
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:164
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:76
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:165
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:77
#: apps/web/src/app/(recipient)/d/[token]/direct-template.tsx:60
#: apps/web/src/components/(teams)/settings/layout/desktop-nav.tsx:43
#: apps/web/src/components/(teams)/settings/layout/mobile-nav.tsx:51
@ -3244,7 +3244,7 @@ msgstr "Le modèle a été mis à jour."
msgid "Template moved"
msgstr "Modèle déplacé"
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:219
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:223
msgid "Template saved"
msgstr "Modèle enregistré"
@ -4521,7 +4521,7 @@ msgstr "Votre document a été créé à partir du modèle avec succès."
msgid "Your document has been re-sent successfully."
msgstr "Votre document a été renvoyé avec succès."
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:322
#: apps/web/src/app/(dashboard)/documents/[id]/edit-document.tsx:324
msgid "Your document has been sent successfully."
msgstr "Votre document a été envoyé avec succès."
@ -4612,7 +4612,7 @@ msgstr "Votre modèle a été supprimé avec succès."
msgid "Your template will be duplicated."
msgstr "Votre modèle sera dupliqué."
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:220
#: apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx:224
msgid "Your templates has been saved successfully."
msgstr "Vos modèles ont été enregistrés avec succès."
@ -4628,4 +4628,3 @@ msgstr "Votre jeton a été créé avec succès ! Assurez-vous de le copier car
#: apps/web/src/app/(teams)/t/[teamUrl]/settings/tokens/page.tsx:86
msgid "Your tokens will be shown here once you create them."
msgstr "Vos jetons seront affichés ici une fois que vous les aurez créés."