diff --git a/src/backend/core/models.py b/src/backend/core/models.py index c17fd3f..12ff022 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -1057,10 +1057,9 @@ class Invitation(BaseInvitation): def _get_mail_subject(self): """Get the subject of the team invitation.""" - role = self.get_role_display().lower() return gettext( - f"[La Suite] You have been invited to become a {role} of a group" - ) + "[La Suite] You have been invited to become a %(role)s of a group" + ) % {"role": self.get_role_display().lower()} def _get_mail_context(self): """Get the template variables for the invitation.""" diff --git a/src/backend/core/tests/test_models_invitations.py b/src/backend/core/tests/test_models_invitations.py index 633228e..936f3c8 100644 --- a/src/backend/core/tests/test_models_invitations.py +++ b/src/backend/core/tests/test_models_invitations.py @@ -246,9 +246,8 @@ def test_models_team_invitations_email(): # pylint: disable-next=no-member assert len(mail.outbox) == 0 - # Please add test for french language after translations update invitation = factories.InvitationFactory( - role="member", team=team, email="john@people.com", issuer__language="en-us" + role="member", team=team, email="john@people.com", issuer__language="fr-fr" ) # pylint: disable-next=no-member @@ -259,13 +258,12 @@ def test_models_team_invitations_email(): assert email.to == [invitation.email] assert ( - email.subject - == "[La Suite] You have been invited to become a member of a group" + email.subject == "[La Suite] Vous avez été invité(e) à être membre d'un groupe" ) email_content = " ".join(email.body.split()) assert ( - f"""You have been invited to be a member of the group "{team.name}" within La Suite.""" + f"""Vous avez été invité(e) à être membre du groupe "{team.name}" au sein de la Suite.""" in email_content ) assert "[//example.com]" in email_content diff --git a/src/backend/locale/fr_FR/LC_MESSAGES/django.mo b/src/backend/locale/fr_FR/LC_MESSAGES/django.mo index c2fc49f..24589ac 100644 Binary files a/src/backend/locale/fr_FR/LC_MESSAGES/django.mo and b/src/backend/locale/fr_FR/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/fr_FR/LC_MESSAGES/django.po b/src/backend/locale/fr_FR/LC_MESSAGES/django.po index a8cab0b..413b984 100644 --- a/src/backend/locale/fr_FR/LC_MESSAGES/django.po +++ b/src/backend/locale/fr_FR/LC_MESSAGES/django.po @@ -324,8 +324,8 @@ msgstr "Invitations d'équipe" #: build/lib/core/models.py:1062 core/models.py:1062 #, python-brace-format -msgid "[La Suite] You have been invited to become a {role} of a group" -msgstr "[La Suite] Vous avez été invité(e) à être {role} d'un groupe" +msgid "[La Suite] You have been invited to become a %(role)s of a group" +msgstr "[La Suite] Vous avez été invité(e) à être %(role)s d'un groupe" #: build/lib/mailbox_manager/admin.py:17 mailbox_manager/admin.py:17 msgid "Synchronise from dimail"