Skip to content

Commit

Permalink
Update translations for permission and anonymization emails
Browse files Browse the repository at this point in the history
  • Loading branch information
matti-lamppu committed Nov 14, 2024
1 parent a13c305 commit 453f5e3
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 96 deletions.
40 changes: 24 additions & 16 deletions locale/fi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2966,38 +2966,46 @@ msgstr "Varausnumero"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid "Your permissions in Varaamo are going to be deactivated"
msgstr "Varaamo-tunnuksesi käyttöoikeudet ovat vanhenemassa"
msgid "Your staff access to Varaamo is expiring"
msgstr "Henkilökunnan käyttöoikeutesi Varaamoon on vanhentumassa"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid ""
"Your account in Varaamo has staff permissions. Since you haven't logged in "
"for a while, these permissions are going to be revoked."
"Your staff access to Varaamo will expire if you do not log in to the service "
"within two weeks."
msgstr ""
"Sähköpostiosoitteellasi on Varaamossa käyttäjätunnus, jolle on myönnetty "
"henkilökunnan käyttöoikeuksia. Koska tunnuksella ei ole kirjauduttu "
"lähiaikoina, tullaan nämä oikeudet poistamaan."
"Henkilökunnan käyttöoikeutesi Varaamoon vanhenee, jos et kirjaudu sisään "
"palveluun kahden viikon kuluessa."

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid "You can login to Varaamo here to prevent this from happening"
msgstr "Voit kirjautua palveluun osoitteessa"
msgid "Log in to the service at"
msgstr "Kirjaudu palveluun osoitteessa"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid "The data in your Varaamo account will be removed soon"
msgstr "Tiedot Varaamo tililläsi tullaan poistamaan pian"
msgid "Your user account in the Varaamo service is expiring"
msgstr "Käyttäjätilisi Varaamo-palveluun on vanhentumassa"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid ""
"Your account in Varaamo has not been used for a while. The data in your "
"account will be removed soon."
"Your user account in the Varaamo service will expire if you do not log in "
"within two weeks. The information will be permanently deleted if your "
"account expires."
msgstr ""
"Sähköpostiosoitteellasi on Varaamossa käyttäjätunnus mutta et ole enää "
"käyttänyt palvelua lähiaikoina. Tunnukseen liittyvät tiedot tullaan "
"poistamaan järjestelmästämme pian."
"Käyttäjätilisi Varaamo-palvelussa vanhenee, jos et kirjaudu sisään palveluun "
"kahden viikon kuluessa. Tiedot poistetaan pysyvästi, jos tilisi vanhenee."

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid ""
"You can extend the validity of your user account by logging into the service "
"at"
msgstr ""
"Voit jatkaa käyttäjätilisi voimassaoloa kirjautumalla sisään palveluun "
"osoitteessa"

#: tilavarauspalvelu/integrations/email/template_context/reservation.py
msgctxt "Email"
Expand Down
39 changes: 25 additions & 14 deletions locale/sv/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2906,36 +2906,47 @@ msgstr "Bokningsnummer"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid "Your permissions in Varaamo are going to be deactivated"
msgstr "Dina behörigheter i Varaamo kommer att avaktiveras"
msgid "Your staff access to Varaamo is expiring"
msgstr "Din personalåtkomst till Varaamo håller på att gå ut"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid ""
"Your account in Varaamo has staff permissions. Since you haven't logged in "
"for a while, these permissions are going to be revoked."
"Your staff access to Varaamo will expire if you do not log in to the service "
"within two weeks."
msgstr ""
"Ditt konto i Varaamo har personalbehörighet. Eftersom du inte har loggat in "
"på ett tag kommer dessa behörigheter att återkallas."
"Din personalåtkomst till Varaamo kommer att upphöra om du inte loggar in på "
"tjänsten inom två veckor."

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid "You can login to Varaamo here to prevent this from happening"
msgstr "Du kan logga in på Varaamo här för att förhindra att detta händer"
msgid "Log in to the service at"
msgstr "Logga in i tjänsten på"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid "The data in your Varaamo account will be removed soon"
msgstr "Uppgifterna i ditt Varaamo-konto kommer snart att tas bort"
msgid "Your user account in the Varaamo service is expiring"
msgstr "Ditt användarkonto i Varaamo-tjänsten håller på att gå ut"

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid ""
"Your account in Varaamo has not been used for a while. The data in your "
"account will be removed soon."
"Your user account in the Varaamo service will expire if you do not log in "
"within two weeks. The information will be permanently deleted if your "
"account expires."
msgstr ""
"Ditt konto i Varaamo har inte använts på ett tag. Uppgifterna på ditt konto "
"kommer snart att tas bort."
"Ditt användarkonto på tjänsten Varaamo kommer att upphöra om du inte loggar "
"in inom två veckor. Informationen kommer att raderas permanent om ditt konto "
"upphör."

#: tilavarauspalvelu/integrations/email/template_context/permissions.py
msgctxt "Email"
msgid ""
"You can extend the validity of your user account by logging into the service "
"at"
msgstr ""
"Du kan förlänga giltigheten för ditt användarkonto genom att logga in på "
"tjänsten på"

#: tilavarauspalvelu/integrations/email/template_context/reservation.py
msgctxt "Email"
Expand Down
20 changes: 10 additions & 10 deletions tests/test_integrations/test_email/test_email_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_email_service__send_permission_deactivation_emails(outbox):

assert len(outbox) == 1

assert outbox[0].subject == "Your permissions in Varaamo are going to be deactivated"
assert outbox[0].subject == "Your staff access to Varaamo is expiring"
assert sorted(outbox[0].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -205,7 +205,7 @@ def test_email_service__send_permission_deactivation_emails__permissions_going_t

assert len(outbox) == 1

assert outbox[0].subject == "Your permissions in Varaamo are going to be deactivated"
assert outbox[0].subject == "Your staff access to Varaamo is expiring"
assert sorted(outbox[0].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -237,7 +237,7 @@ def test_email_service__send_permission_deactivation_emails__general_admin(outbo

assert len(outbox) == 1

assert outbox[0].subject == "Your permissions in Varaamo are going to be deactivated"
assert outbox[0].subject == "Your staff access to Varaamo is expiring"
assert sorted(outbox[0].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -270,7 +270,7 @@ def test_email_service__send_permission_deactivation_emails__unit_admin(outbox):

assert len(outbox) == 1

assert outbox[0].subject == "Your permissions in Varaamo are going to be deactivated"
assert outbox[0].subject == "Your staff access to Varaamo is expiring"
assert sorted(outbox[0].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -309,10 +309,10 @@ def test_email_service__send_permission_deactivation_emails__multiple_languages(

assert len(outbox) == 2

assert outbox[0].subject == "Varaamo-tunnuksesi käyttöoikeudet ovat vanhenemassa"
assert outbox[0].subject == "Henkilökunnan käyttöoikeutesi Varaamoon on vanhentumassa"
assert sorted(outbox[0].bcc) == ["[email protected]"]

assert outbox[1].subject == "Your permissions in Varaamo are going to be deactivated"
assert outbox[1].subject == "Your staff access to Varaamo is expiring"
assert sorted(outbox[1].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -362,7 +362,7 @@ def test_email_service__send_user_anonymization_emails(outbox):

assert len(outbox) == 1

assert outbox[0].subject == "The data in your Varaamo account will be removed soon"
assert outbox[0].subject == "Your user account in the Varaamo service is expiring"
assert sorted(outbox[0].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -423,7 +423,7 @@ def test_email_service__send_user_anonymization_emails__going_to_be_old(outbox):

assert len(outbox) == 1

assert outbox[0].subject == "The data in your Varaamo account will be removed soon"
assert outbox[0].subject == "Your user account in the Varaamo service is expiring"
assert sorted(outbox[0].bcc) == ["[email protected]"]


Expand Down Expand Up @@ -470,10 +470,10 @@ def test_email_service__send_user_anonymization_emails__multiple_languages(outbo

assert len(outbox) == 2

assert outbox[0].subject == "Tiedot Varaamo tililläsi tullaan poistamaan pian"
assert outbox[0].subject == "Käyttäjätilisi Varaamo-palveluun on vanhentumassa"
assert sorted(outbox[0].bcc) == ["[email protected]"]

assert outbox[1].subject == "The data in your Varaamo account will be removed soon"
assert outbox[1].subject == "Your user account in the Varaamo service is expiring"
assert sorted(outbox[1].bcc) == ["[email protected]"]


Expand Down
47 changes: 24 additions & 23 deletions tests/test_integrations/test_email/test_permission_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ def test_get_context__permission_deactivation__en():

assert context == {
"email_recipient_name": None,
"title": "Your permissions in Varaamo are going to be deactivated",
"title": "Your staff access to Varaamo is expiring",
"text_permission_deactivation": (
"Your account in Varaamo has staff permissions. "
"Since you haven't logged in for a while, these permissions are going to be revoked."
"Your staff access to Varaamo will expire if you do not log in to the service within two weeks."
),
"text_login_to_prevent": "You can login to Varaamo here to prevent this from happening",
"text_login_to_prevent": "Log in to the service at",
"login_url": "https://fake.varaamo.hel.fi/kasittely",
"login_url_html": '<a href="https://fake.varaamo.hel.fi/kasittely">https://fake.varaamo.hel.fi/kasittely</a>',
**BASE_TEMPLATE_CONTEXT_EN,
Expand All @@ -48,12 +47,12 @@ def test_get_context__permission_deactivation__fi():

assert context == {
"email_recipient_name": None,
"title": "Varaamo-tunnuksesi käyttöoikeudet ovat vanhenemassa",
"title": "Henkilökunnan käyttöoikeutesi Varaamoon on vanhentumassa",
"text_permission_deactivation": (
"Sähköpostiosoitteellasi on Varaamossa käyttäjätunnus, jolle on myönnetty henkilökunnan käyttöoikeuksia. "
"Koska tunnuksella ei ole kirjauduttu lähiaikoina, tullaan nämä oikeudet poistamaan."
"Henkilökunnan käyttöoikeutesi Varaamoon vanhenee, "
"jos et kirjaudu sisään palveluun kahden viikon kuluessa."
),
"text_login_to_prevent": "Voit kirjautua palveluun osoitteessa",
"text_login_to_prevent": "Kirjaudu palveluun osoitteessa",
"login_url": "https://fake.varaamo.hel.fi/kasittely",
"login_url_html": '<a href="https://fake.varaamo.hel.fi/kasittely">https://fake.varaamo.hel.fi/kasittely</a>',
**BASE_TEMPLATE_CONTEXT_FI,
Expand All @@ -69,12 +68,11 @@ def test_get_context__permission_deactivation__sv():

assert context == {
"email_recipient_name": None,
"title": "Dina behörigheter i Varaamo kommer att avaktiveras",
"title": "Din personalåtkomst till Varaamo håller på att gå ut",
"text_permission_deactivation": (
"Ditt konto i Varaamo har personalbehörighet. "
"Eftersom du inte har loggat in på ett tag kommer dessa behörigheter att återkallas."
"Din personalåtkomst till Varaamo kommer att upphöra om du inte loggar in på tjänsten inom två veckor."
),
"text_login_to_prevent": "Du kan logga in på Varaamo här för att förhindra att detta händer",
"text_login_to_prevent": "Logga in i tjänsten på",
"login_url": "https://fake.varaamo.hel.fi/kasittely",
"login_url_html": '<a href="https://fake.varaamo.hel.fi/kasittely">https://fake.varaamo.hel.fi/kasittely</a>',
**BASE_TEMPLATE_CONTEXT_SV,
Expand All @@ -90,11 +88,12 @@ def test_get_context__user_anonymization__en():

assert context == {
"email_recipient_name": None,
"title": "The data in your Varaamo account will be removed soon",
"title": "Your user account in the Varaamo service is expiring",
"text_user_anonymization": (
"Your account in Varaamo has not been used for a while. The data in your account will be removed soon."
"Your user account in the Varaamo service will expire if you do not log in within two weeks. "
"The information will be permanently deleted if your account expires."
),
"text_login_to_prevent": "You can login to Varaamo here to prevent this from happening",
"text_login_to_prevent": "You can extend the validity of your user account by logging into the service at",
"login_url": "https://fake.varaamo.hel.fi/en",
"login_url_html": '<a href="https://fake.varaamo.hel.fi/en">https://fake.varaamo.hel.fi/en</a>',
**BASE_TEMPLATE_CONTEXT_EN,
Expand All @@ -110,13 +109,12 @@ def test_get_context__user_anonymization__fi():

assert context == {
"email_recipient_name": None,
"title": "Tiedot Varaamo tililläsi tullaan poistamaan pian",
"title": "Käyttäjätilisi Varaamo-palveluun on vanhentumassa",
"text_user_anonymization": (
"Sähköpostiosoitteellasi on Varaamossa käyttäjätunnus mutta et ole enää "
"käyttänyt palvelua lähiaikoina. Tunnukseen liittyvät tiedot tullaan "
"poistamaan järjestelmästämme pian."
"Käyttäjätilisi Varaamo-palvelussa vanhenee, jos et kirjaudu sisään palveluun kahden viikon kuluessa. "
"Tiedot poistetaan pysyvästi, jos tilisi vanhenee."
),
"text_login_to_prevent": "Voit kirjautua palveluun osoitteessa",
"text_login_to_prevent": "Voit jatkaa käyttäjätilisi voimassaoloa kirjautumalla sisään palveluun osoitteessa",
"login_url": "https://fake.varaamo.hel.fi",
"login_url_html": '<a href="https://fake.varaamo.hel.fi">https://fake.varaamo.hel.fi</a>',
**BASE_TEMPLATE_CONTEXT_FI,
Expand All @@ -132,11 +130,14 @@ def test_get_context__user_anonymization__sv():

assert context == {
"email_recipient_name": None,
"title": "Uppgifterna i ditt Varaamo-konto kommer snart att tas bort",
"title": "Ditt användarkonto i Varaamo-tjänsten håller på att gå ut",
"text_user_anonymization": (
"Ditt konto i Varaamo har inte använts på ett tag. Uppgifterna på ditt konto kommer snart att tas bort."
"Ditt användarkonto på tjänsten Varaamo kommer att upphöra om du inte loggar in inom två veckor. "
"Informationen kommer att raderas permanent om ditt konto upphör."
),
"text_login_to_prevent": (
"Du kan förlänga giltigheten för ditt användarkonto genom att logga in på tjänsten på"
),
"text_login_to_prevent": "Du kan logga in på Varaamo här för att förhindra att detta händer",
"login_url": "https://fake.varaamo.hel.fi/sv",
"login_url_html": '<a href="https://fake.varaamo.hel.fi/sv">https://fake.varaamo.hel.fi/sv</a>',
**BASE_TEMPLATE_CONTEXT_SV,
Expand Down
22 changes: 11 additions & 11 deletions tests/test_integrations/test_email/test_render_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,17 @@ def test_render_permission_deactivation__html():
html_content = render_html(email_type=EmailType.PERMISSION_DEACTIVATION, context=context)
text_content = html_email_to_text(html_content)

message = (
"Your account in Varaamo has staff permissions. "
"Since you haven't logged in for a while, these permissions are going to be revoked."
)

assert text_content == cleandoc(
f"""
"""
![](https://makasiini.hel.ninja/helsinki-logos/helsinki-logo-black.png)
**Varaamo**
**Hi,**
{message}
Your staff access to Varaamo will expire if you do not log in to the service within two weeks.
You can login to Varaamo here to prevent this from happening:
Log in to the service at:
<https://fake.varaamo.hel.fi/kasittely>
Kind regards
Expand All @@ -205,17 +200,22 @@ def test_render_user_anonymization__html():
html_content = render_html(email_type=EmailType.USER_ANONYMIZATION, context=context)
text_content = html_email_to_text(html_content)

message = (
"Your user account in the Varaamo service will expire if you do not log in within two weeks. "
"The information will be permanently deleted if your account expires."
)

assert text_content == cleandoc(
"""
f"""
![](https://makasiini.hel.ninja/helsinki-logos/helsinki-logo-black.png)
**Varaamo**
**Hi,**
Your account in Varaamo has not been used for a while. The data in your account will be removed soon.
{message}
You can login to Varaamo here to prevent this from happening:
You can extend the validity of your user account by logging into the service at:
<https://fake.varaamo.hel.fi/en>
Kind regards
Expand Down
Loading

0 comments on commit 453f5e3

Please sign in to comment.