chore: add i18n lang to document deleted email

This commit is contained in:
Mythie
2024-11-05 13:44:00 +11:00
parent c57d1dc55d
commit dc5723c386
11 changed files with 12 additions and 12 deletions

View File

@@ -2,12 +2,15 @@
import { createElement } from 'react'; import { createElement } from 'react';
import { msg } from '@lingui/macro';
import { mailer } from '@documenso/email/mailer'; import { mailer } from '@documenso/email/mailer';
import DocumentCancelTemplate from '@documenso/email/templates/document-cancel'; import DocumentCancelTemplate from '@documenso/email/templates/document-cancel';
import { prisma } from '@documenso/prisma'; import { prisma } from '@documenso/prisma';
import type { Document, DocumentMeta, Recipient, User } from '@documenso/prisma/client'; import type { Document, DocumentMeta, Recipient, User } from '@documenso/prisma/client';
import { DocumentStatus, SendStatus } from '@documenso/prisma/client'; import { DocumentStatus, SendStatus } from '@documenso/prisma/client';
import { getI18nInstance } from '../../client-only/providers/i18n.server';
import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app'; import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
import { FROM_ADDRESS, FROM_NAME } from '../../constants/email'; import { FROM_ADDRESS, FROM_NAME } from '../../constants/email';
import { DOCUMENT_AUDIT_LOG_TYPE } from '../../types/document-audit-logs'; import { DOCUMENT_AUDIT_LOG_TYPE } from '../../types/document-audit-logs';
@@ -192,10 +195,12 @@ const handleDocumentOwnerDelete = async ({
}); });
const [html, text] = await Promise.all([ const [html, text] = await Promise.all([
renderEmailWithI18N(template), renderEmailWithI18N(template, { lang: document.documentMeta?.language }),
renderEmailWithI18N(template, { plainText: true }), renderEmailWithI18N(template, { lang: document.documentMeta?.language, plainText: true }),
]); ]);
const i18n = await getI18nInstance(document.documentMeta?.language);
await mailer.sendMail({ await mailer.sendMail({
to: { to: {
address: recipient.email, address: recipient.email,
@@ -205,7 +210,7 @@ const handleDocumentOwnerDelete = async ({
name: FROM_NAME, name: FROM_NAME,
address: FROM_ADDRESS, address: FROM_ADDRESS,
}, },
subject: 'Document Cancelled', subject: i18n._(msg`Document Cancelled`),
html, html,
text, text,
}); });

View File

@@ -450,6 +450,7 @@ msgstr "Empfänger des direkten Links"
msgid "Document access" msgid "Document access"
msgstr "Dokumentenzugriff" msgstr "Dokumentenzugriff"
#: packages/lib/server-only/document/delete-document.ts:213
#: packages/lib/server-only/document/super-delete-document.ts:75 #: packages/lib/server-only/document/super-delete-document.ts:75
msgid "Document Cancelled" msgid "Document Cancelled"
msgstr "Dokument storniert" msgstr "Dokument storniert"
@@ -1309,4 +1310,3 @@ msgstr "Dein Passwort wurde aktualisiert."
#: packages/email/templates/team-delete.tsx:30 #: packages/email/templates/team-delete.tsx:30
msgid "Your team has been deleted" msgid "Your team has been deleted"
msgstr "Dein Team wurde gelöscht" msgstr "Dein Team wurde gelöscht"

View File

@@ -602,4 +602,3 @@ msgstr "Sie können Documenso kostenlos selbst hosten oder unsere sofort einsatz
#: apps/marketing/src/components/(marketing)/carousel.tsx:272 #: apps/marketing/src/components/(marketing)/carousel.tsx:272
msgid "Your browser does not support the video tag." msgid "Your browser does not support the video tag."
msgstr "Ihr Browser unterstützt das Video-Tag nicht." msgstr "Ihr Browser unterstützt das Video-Tag nicht."

View File

@@ -4628,4 +4628,3 @@ msgstr "Ihr Token wurde erfolgreich erstellt! Stellen Sie sicher, dass Sie es ko
#: apps/web/src/app/(teams)/t/[teamUrl]/settings/tokens/page.tsx:86 #: apps/web/src/app/(teams)/t/[teamUrl]/settings/tokens/page.tsx:86
msgid "Your tokens will be shown here once you create them." msgid "Your tokens will be shown here once you create them."
msgstr "Ihre Tokens werden hier angezeigt, sobald Sie sie erstellt haben." msgstr "Ihre Tokens werden hier angezeigt, sobald Sie sie erstellt haben."

View File

@@ -445,6 +445,7 @@ msgstr "Direct link receiver"
msgid "Document access" msgid "Document access"
msgstr "Document access" msgstr "Document access"
#: packages/lib/server-only/document/delete-document.ts:213
#: packages/lib/server-only/document/super-delete-document.ts:75 #: packages/lib/server-only/document/super-delete-document.ts:75
msgid "Document Cancelled" msgid "Document Cancelled"
msgstr "Document Cancelled" msgstr "Document Cancelled"

View File

@@ -450,6 +450,7 @@ msgstr "Receptor de enlace directo"
msgid "Document access" msgid "Document access"
msgstr "Acceso al documento" msgstr "Acceso al documento"
#: packages/lib/server-only/document/delete-document.ts:213
#: packages/lib/server-only/document/super-delete-document.ts:75 #: packages/lib/server-only/document/super-delete-document.ts:75
msgid "Document Cancelled" msgid "Document Cancelled"
msgstr "Documento cancelado" msgstr "Documento cancelado"
@@ -1309,4 +1310,3 @@ msgstr "Tu contraseña ha sido actualizada."
#: packages/email/templates/team-delete.tsx:30 #: packages/email/templates/team-delete.tsx:30
msgid "Your team has been deleted" msgid "Your team has been deleted"
msgstr "Tu equipo ha sido eliminado" msgstr "Tu equipo ha sido eliminado"

View File

@@ -602,4 +602,3 @@ msgstr "Puedes autoalojar Documenso de forma gratuita o usar nuestra versión al
#: apps/marketing/src/components/(marketing)/carousel.tsx:272 #: apps/marketing/src/components/(marketing)/carousel.tsx:272
msgid "Your browser does not support the video tag." msgid "Your browser does not support the video tag."
msgstr "Tu navegador no soporta la etiqueta de video." msgstr "Tu navegador no soporta la etiqueta de video."

View File

@@ -4628,4 +4628,3 @@ msgstr "¡Tu token se creó con éxito! ¡Asegúrate de copiarlo porque no podr
#: apps/web/src/app/(teams)/t/[teamUrl]/settings/tokens/page.tsx:86 #: apps/web/src/app/(teams)/t/[teamUrl]/settings/tokens/page.tsx:86
msgid "Your tokens will be shown here once you create them." msgid "Your tokens will be shown here once you create them."
msgstr "Tus tokens se mostrarán aquí una vez que los crees." msgstr "Tus tokens se mostrarán aquí una vez que los crees."

View File

@@ -450,6 +450,7 @@ msgstr "Receveur de lien direct"
msgid "Document access" msgid "Document access"
msgstr "Accès au document" msgstr "Accès au document"
#: packages/lib/server-only/document/delete-document.ts:213
#: packages/lib/server-only/document/super-delete-document.ts:75 #: packages/lib/server-only/document/super-delete-document.ts:75
msgid "Document Cancelled" msgid "Document Cancelled"
msgstr "Document Annulé" msgstr "Document Annulé"
@@ -1309,4 +1310,3 @@ msgstr "Votre mot de passe a été mis à jour."
#: packages/email/templates/team-delete.tsx:30 #: packages/email/templates/team-delete.tsx:30
msgid "Your team has been deleted" msgid "Your team has been deleted"
msgstr "Votre équipe a été supprimée" msgstr "Votre équipe a été supprimée"

View File

@@ -602,4 +602,3 @@ msgstr "Vous pouvez auto-héberger Documenso gratuitement ou utiliser notre vers
#: apps/marketing/src/components/(marketing)/carousel.tsx:272 #: apps/marketing/src/components/(marketing)/carousel.tsx:272
msgid "Your browser does not support the video tag." msgid "Your browser does not support the video tag."
msgstr "Votre navigateur ne prend pas en charge la balise vidéo." msgstr "Votre navigateur ne prend pas en charge la balise vidéo."

View File

@@ -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 #: apps/web/src/app/(teams)/t/[teamUrl]/settings/tokens/page.tsx:86
msgid "Your tokens will be shown here once you create them." 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." msgstr "Vos jetons seront affichés ici une fois que vous les aurez créés."