Skip to content

Commit

Permalink
Revert attempt to move loading of translations to the server side
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait committed Feb 2, 2025
1 parent d7a861d commit c25ea73
Show file tree
Hide file tree
Showing 33 changed files with 330 additions and 164 deletions.
10 changes: 3 additions & 7 deletions packages/twenty-emails/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/locales/generated/*": {
"import": "./dist/locales/generated/*.mjs",
"require": "./dist/locales/generated/*.js",
"types": "./dist/locales/generated/*.d.ts"
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"engines": {
"node": "^18.17.1",
"node": "^18.17.1",
"npm": "please-use-yarn",
"yarn": "^4.0.2"
}
Expand Down
27 changes: 27 additions & 0 deletions packages/twenty-emails/src/components/BaseEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,39 @@ import { PropsWithChildren } from 'react';
import { BaseHead } from 'src/components/BaseHead';
import { Logo } from 'src/components/Logo';
import { APP_LOCALES } from 'twenty-shared';
import { messages as deMessages } from '../locales/generated/de';
import { messages as enMessages } from '../locales/generated/en';
import { messages as esMessages } from '../locales/generated/es';
import { messages as frMessages } from '../locales/generated/fr';
import { messages as itMessages } from '../locales/generated/it';
import { messages as jaMessages } from '../locales/generated/ja';
import { messages as koMessages } from '../locales/generated/ko';
import { messages as pseudoEnMessages } from '../locales/generated/pseudo-en';
import { messages as ptBRMessages } from '../locales/generated/pt-BR';
import { messages as ptPTMessages } from '../locales/generated/pt-PT';
import { messages as zhHansMessages } from '../locales/generated/zh-Hans';
import { messages as zhHantMessages } from '../locales/generated/zh-Hant';

type BaseEmailProps = PropsWithChildren<{
width?: number;
locale: keyof typeof APP_LOCALES;
}>;

i18n.load('en', enMessages);
i18n.load('fr', frMessages);
i18n.load('pseudo-en', pseudoEnMessages);
i18n.load('ko', koMessages);
i18n.load('de', deMessages);
i18n.load('it', itMessages);
i18n.load('es', esMessages);
i18n.load('ja', jaMessages);
i18n.load('pt-PT', ptPTMessages);
i18n.load('pt-BR', ptBRMessages);
i18n.load('zh-Hans', zhHansMessages);
i18n.load('zh-Hant', zhHantMessages);

i18n.activate('en');

export const BaseEmail = ({ children, width, locale }: BaseEmailProps) => {
i18n.activate(locale);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const PasswordUpdateNotifyEmail = ({
link,
locale,
}: PasswordUpdateNotifyEmailProps) => {
const helloString = userName?.length > 1 ? t`Dear ${userName}` : t`Dear`;
const helloString = userName?.length > 1 ? t`Dear ${userName}` : t`Hello`;
const formattedDate = i18n.date(new Date());

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { t } from '@lingui/core/macro';
import { Trans } from '@lingui/react/macro';
import { BaseEmail } from 'src/components/BaseEmail';
import { CallToAction } from 'src/components/CallToAction';
Expand Down Expand Up @@ -49,7 +50,7 @@ export const WarnSuspendedWorkspaceEmail = ({
</MainText>
<CallToAction
href="https://app.twenty.com/settings/billing"
value="Update your subscription"
value={t`Update your subscription`}
/>
</BaseEmail>
);
Expand Down
32 changes: 24 additions & 8 deletions packages/twenty-emails/src/locales/de.po
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2025-02-02 13:19+0100\n"
"POT-Creation-Date: 2025-02-02 20:44+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -23,27 +23,27 @@ msgstr "Bestätigen Sie Ihre E-Mail Adresse"
msgid "Connect to Twenty"
msgstr "Verbindung zu Twenty"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear"
msgstr "Liebe"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear {userName}"
msgstr "Sehr geehrter {userName}"

#: src/emails/password-update-notify.email.tsx:24
msgid "Hello"
msgstr "Hallo"

#: src/emails/password-update-notify.email.tsx:40
msgid "If you did not initiate this change, please contact your workspace owner immediately."
msgstr "Wenn Sie diese Änderung nicht veranlasst haben, wenden Sie sich bitte umgehend an den Eigentümer Ihres Arbeitsbereichs."

#: src/emails/warn-suspended-workspace.email.tsx:45
#: src/emails/warn-suspended-workspace.email.tsx:46
msgid "If you wish to continue using Twenty, please update your subscription within the next {remainingDays} {dayOrDays}."
msgstr "Wenn Sie Twenty weiterhin nutzen möchten, aktualisieren Sie Ihr Abonnement bitte innerhalb der nächsten {remainingDays} {dayOrDays}."

#: src/emails/clean-suspended-workspace.email.tsx:36
msgid "If you wish to use Twenty again, you can create a new workspace."
msgstr "Wenn Sie Twenty wieder verwenden möchten, können Sie einen neuen Arbeitsbereich erstellen."

#: src/emails/warn-suspended-workspace.email.tsx:33
#: src/emails/warn-suspended-workspace.email.tsx:34
msgid "It appears that your workspace <0>{workspaceDisplayName}</0> has been suspended for {daysSinceInactive} days."
msgstr "Es scheint, dass Ihr Arbeitsbereich <0>{workspaceDisplayName}</0> für {daysSinceInactive} Tage gesperrt wurde."

Expand All @@ -55,18 +55,34 @@ msgstr "Verbinden Sie Ihr Team auf Twenty"
msgid "Password updated"
msgstr "Passwort aktualisiert"

#: src/emails/password-reset-link.email.tsx:24
msgid "Reset"
msgstr "Zurücksetzen"

#: src/emails/password-reset-link.email.tsx:23
msgid "Reset your password 🗝"
msgstr "Ihr Passwort zurücksetzen 🗝"

#: src/emails/send-email-verification-link.email.tsx:27
msgid "Thanks for registering for an account on Twenty! Before we get started, we just need to confirm that this is you. Click above to verify your email address."
msgstr "Vielen Dank, dass Sie sich für ein Konto bei Twenty registriert haben! Bevor wir loslegen, müssen wir nur bestätigen, dass Sie es sind. Klicken Sie oben, um Ihre E-Mail-Adresse zu bestätigen."

#: src/emails/warn-suspended-workspace.email.tsx:39
#: src/emails/warn-suspended-workspace.email.tsx:40
msgid "The workspace will be deactivated in {remainingDays} {dayOrDays}, and all its data will be deleted."
msgstr "Der Arbeitsbereich wird in {remainingDays} {dayOrDays} deaktiviert, und alle seine Daten werden gelöscht."

#: src/emails/password-update-notify.email.tsx:34
msgid "This is a confirmation that password for your account ({email}) was successfully changed on {formattedDate}."
msgstr "Dies ist eine Bestätigung, dass das Passwort für Ihr Konto ({email}) erfolgreich am {formattedDate} geändert wurde."

#: src/emails/password-reset-link.email.tsx:26
msgid "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"
msgstr "Dieser Link ist nur für den nächsten {duration} gültig. Wenn der Link nicht funktioniert, können Sie direkt den Link zur Überprüfung der Anmeldung verwenden:"

#: src/emails/warn-suspended-workspace.email.tsx:53
msgid "Update your subscription"
msgstr "Aktualisieren Sie Ihr Abonnement"

#: src/emails/send-email-verification-link.email.tsx:23
msgid "Verify Email"
msgstr "E-Mail verifizieren"
Expand Down
30 changes: 19 additions & 11 deletions packages/twenty-emails/src/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ msgid "Connect to Twenty"
msgstr "Connect to Twenty"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear"
msgstr "Dear"
#~ msgid "Dear"
#~ msgstr "Dear"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear {userName}"
Expand All @@ -41,19 +41,23 @@ msgstr "Dear {userName}"
msgid "has invited you to join a workspace called "
msgstr "has invited you to join a workspace called "

#: src/emails/password-update-notify.email.tsx:24
msgid "Hello"
msgstr "Hello"

#: src/emails/password-update-notify.email.tsx:40
msgid "If you did not initiate this change, please contact your workspace owner immediately."
msgstr "If you did not initiate this change, please contact your workspace owner immediately."

#: src/emails/warn-suspended-workspace.email.tsx:45
#: src/emails/warn-suspended-workspace.email.tsx:46
msgid "If you wish to continue using Twenty, please update your subscription within the next {remainingDays} {dayOrDays}."
msgstr "If you wish to continue using Twenty, please update your subscription within the next {remainingDays} {dayOrDays}."

#: src/emails/clean-suspended-workspace.email.tsx:36
msgid "If you wish to use Twenty again, you can create a new workspace."
msgstr "If you wish to use Twenty again, you can create a new workspace."

#: src/emails/warn-suspended-workspace.email.tsx:33
#: src/emails/warn-suspended-workspace.email.tsx:34
msgid "It appears that your workspace <0>{workspaceDisplayName}</0> has been suspended for {daysSinceInactive} days."
msgstr "It appears that your workspace <0>{workspaceDisplayName}</0> has been suspended for {daysSinceInactive} days."

Expand All @@ -66,18 +70,18 @@ msgid "Password updated"
msgstr "Password updated"

#: src/emails/password-reset-link.email.tsx:24
#~ msgid "Reset"
#~ msgstr "Reset"
msgid "Reset"
msgstr "Reset"

#: src/emails/password-reset-link.email.tsx:23
#~ msgid "Reset your password 🗝"
#~ msgstr "Reset your password 🗝"
msgid "Reset your password 🗝"
msgstr "Reset your password 🗝"

#: src/emails/send-email-verification-link.email.tsx:27
msgid "Thanks for registering for an account on Twenty! Before we get started, we just need to confirm that this is you. Click above to verify your email address."
msgstr "Thanks for registering for an account on Twenty! Before we get started, we just need to confirm that this is you. Click above to verify your email address."

#: src/emails/warn-suspended-workspace.email.tsx:39
#: src/emails/warn-suspended-workspace.email.tsx:40
msgid "The workspace will be deactivated in {remainingDays} {dayOrDays}, and all its data will be deleted."
msgstr "The workspace will be deactivated in {remainingDays} {dayOrDays}, and all its data will be deleted."

Expand All @@ -90,13 +94,17 @@ msgstr "This is a confirmation that password for your account ({email}) was succ
#~ msgstr "This is a confirmation that password for your account ({email}) was successfully changed on {formattedDate}.<0/><1/>If you did not initiate this change, please contact your workspace owner immediately."

#: src/emails/password-reset-link.email.tsx:26
#~ msgid "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"
#~ msgstr "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"
msgid "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"
msgstr "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"

#: src/emails/password-reset-link.email.tsx:28
#~ msgid "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:<0/>"
#~ msgstr "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:<0/>"

#: src/emails/warn-suspended-workspace.email.tsx:53
msgid "Update your subscription"
msgstr "Update your subscription"

#: src/emails/send-email-verification-link.email.tsx:23
msgid "Verify Email"
msgstr "Verify Email"
Expand Down
32 changes: 24 additions & 8 deletions packages/twenty-emails/src/locales/es.po
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2025-02-02 13:19+0100\n"
"POT-Creation-Date: 2025-02-02 20:44+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -23,27 +23,27 @@ msgstr "Confirma tu dirección de correo electrónico"
msgid "Connect to Twenty"
msgstr "Conectarse a Twenty"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear"
msgstr "Estimado/a"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear {userName}"
msgstr "Estimado/a {userName}"

#: src/emails/password-update-notify.email.tsx:24
msgid "Hello"
msgstr "Hola"

#: src/emails/password-update-notify.email.tsx:40
msgid "If you did not initiate this change, please contact your workspace owner immediately."
msgstr "Si usted no ha iniciado este cambio, póngase en contacto inmediatamente con el propietario de su espacio de trabajo."

#: src/emails/warn-suspended-workspace.email.tsx:45
#: src/emails/warn-suspended-workspace.email.tsx:46
msgid "If you wish to continue using Twenty, please update your subscription within the next {remainingDays} {dayOrDays}."
msgstr "Si desea seguir utilizando Twenty, actualice su suscripción en los próximos {remainingDays} {dayOrDays}."

#: src/emails/clean-suspended-workspace.email.tsx:36
msgid "If you wish to use Twenty again, you can create a new workspace."
msgstr "Si deseas volver a utilizar Twenty, puedes crear un nuevo espacio de trabajo."

#: src/emails/warn-suspended-workspace.email.tsx:33
#: src/emails/warn-suspended-workspace.email.tsx:34
msgid "It appears that your workspace <0>{workspaceDisplayName}</0> has been suspended for {daysSinceInactive} days."
msgstr "Parece que su espacio de trabajo <0>{workspaceDisplayName}</0> ha sido suspendido durante {daysSinceInactive} días."

Expand All @@ -55,18 +55,34 @@ msgstr "Únete a tu equipo en Twenty"
msgid "Password updated"
msgstr "Contraseña actualizada"

#: src/emails/password-reset-link.email.tsx:24
msgid "Reset"
msgstr "Restablecer"

#: src/emails/password-reset-link.email.tsx:23
msgid "Reset your password 🗝"
msgstr "Restablece tu contraseña 🗝"

#: src/emails/send-email-verification-link.email.tsx:27
msgid "Thanks for registering for an account on Twenty! Before we get started, we just need to confirm that this is you. Click above to verify your email address."
msgstr "¡Gracias por registrarte en Twenty! Antes de comenzar, solo necesitamos confirmar que eres tú. Haz clic arriba para verificar tu dirección de correo electrónico."

#: src/emails/warn-suspended-workspace.email.tsx:39
#: src/emails/warn-suspended-workspace.email.tsx:40
msgid "The workspace will be deactivated in {remainingDays} {dayOrDays}, and all its data will be deleted."
msgstr "El espacio de trabajo se desactivará en {remainingDays} {dayOrDays} y se borrarán todos sus datos."

#: src/emails/password-update-notify.email.tsx:34
msgid "This is a confirmation that password for your account ({email}) was successfully changed on {formattedDate}."
msgstr "Esto es una confirmación de que la contraseña de su cuenta ({email}) se ha cambiado correctamente en {formattedDate}."

#: src/emails/password-reset-link.email.tsx:26
msgid "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"
msgstr "Este enlace sólo es válido para el próximo {duration}. Si el enlace no funciona, puede utilizar directamente el enlace de verificación de inicio de sesión:"

#: src/emails/warn-suspended-workspace.email.tsx:53
msgid "Update your subscription"
msgstr "Actualice su suscripción"

#: src/emails/send-email-verification-link.email.tsx:23
msgid "Verify Email"
msgstr "Verificar correo electrónico"
Expand Down
32 changes: 24 additions & 8 deletions packages/twenty-emails/src/locales/fr.po
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2025-02-02 13:19+0100\n"
"POT-Creation-Date: 2025-02-02 20:44+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -23,27 +23,27 @@ msgstr "Confirmez votre adresse email"
msgid "Connect to Twenty"
msgstr "Connectez-vous à Twenty"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear"
msgstr "Cher(e)"

#: src/emails/password-update-notify.email.tsx:24
msgid "Dear {userName}"
msgstr "Cher(e) {userName}"

#: src/emails/password-update-notify.email.tsx:24
msgid "Hello"
msgstr "Bonjour"

#: src/emails/password-update-notify.email.tsx:40
msgid "If you did not initiate this change, please contact your workspace owner immediately."
msgstr "Si vous n'êtes pas à l'origine de ce changement, veuillez contacter immédiatement le propriétaire de votre espace de travail."

#: src/emails/warn-suspended-workspace.email.tsx:45
#: src/emails/warn-suspended-workspace.email.tsx:46
msgid "If you wish to continue using Twenty, please update your subscription within the next {remainingDays} {dayOrDays}."
msgstr "Si vous souhaitez continuer à utiliser Twenty, veuillez mettre à jour votre abonnement dans les {remainingDays} {dayOrDays} à venir."

#: src/emails/clean-suspended-workspace.email.tsx:36
msgid "If you wish to use Twenty again, you can create a new workspace."
msgstr "Si vous souhaitez réutiliser Twenty, vous pouvez créer un nouvel espace de travail."

#: src/emails/warn-suspended-workspace.email.tsx:33
#: src/emails/warn-suspended-workspace.email.tsx:34
msgid "It appears that your workspace <0>{workspaceDisplayName}</0> has been suspended for {daysSinceInactive} days."
msgstr "Il apparaît que votre espace de travail <0>{workspaceDisplayName}</0> a été suspendu pendant {daysSinceInactive} jours."

Expand All @@ -55,18 +55,34 @@ msgstr "Rejoignez votre équipe sur Twenty"
msgid "Password updated"
msgstr "Mot de passe mis à jour"

#: src/emails/password-reset-link.email.tsx:24
msgid "Reset"
msgstr "Réinitialiser"

#: src/emails/password-reset-link.email.tsx:23
msgid "Reset your password 🗝"
msgstr "Réinitialiser votre mot de passe 🗝"

#: src/emails/send-email-verification-link.email.tsx:27
msgid "Thanks for registering for an account on Twenty! Before we get started, we just need to confirm that this is you. Click above to verify your email address."
msgstr "Merci de vous être inscrit sur Twenty! Avant de commencer, nous devons simplement confirmer qu'il s'agit bien de vous. Cliquez ci-dessus pour vérifier votre adresse e-mail."

#: src/emails/warn-suspended-workspace.email.tsx:39
#: src/emails/warn-suspended-workspace.email.tsx:40
msgid "The workspace will be deactivated in {remainingDays} {dayOrDays}, and all its data will be deleted."
msgstr "L'espace de travail sera désactivé dans {remainingDays} {dayOrDays} et toutes ses données seront supprimées."

#: src/emails/password-update-notify.email.tsx:34
msgid "This is a confirmation that password for your account ({email}) was successfully changed on {formattedDate}."
msgstr "Ceci est une confirmation que le mot de passe de votre compte ({email}) a été modifié avec succès le {formattedDate}."

#: src/emails/password-reset-link.email.tsx:26
msgid "This link is only valid for the next {duration}. If the link does not work, you can use the login verification link directly:"
msgstr "Ce lien n'est valable que pour le prochain {duration}. Si le lien ne fonctionne pas, vous pouvez utiliser directement le lien de vérification de la connexion :"

#: src/emails/warn-suspended-workspace.email.tsx:53
msgid "Update your subscription"
msgstr "Mise à jour de votre abonnement"

#: src/emails/send-email-verification-link.email.tsx:23
msgid "Verify Email"
msgstr "Vérifier l'e-mail"
Expand Down
Loading

0 comments on commit c25ea73

Please sign in to comment.