From 90c5334dc1cc16059c2886ac1cc0885ce2e075d0 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Tue, 23 Jan 2018 16:02:40 -0500 Subject: [PATCH] make invites and reset emails translatable again --- ckan/templates/emails/invite_user.txt | 9 ++++++--- ckan/templates/emails/invite_user_subject.txt | 2 +- ckan/templates/emails/reset_password.txt | 8 ++++++-- ckan/templates/emails/reset_password_subject.txt | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ckan/templates/emails/invite_user.txt b/ckan/templates/emails/invite_user.txt index 7fefc0c8c1a..77a462ae41b 100644 --- a/ckan/templates/emails/invite_user.txt +++ b/ckan/templates/emails/invite_user.txt @@ -1,5 +1,6 @@ -Dear {{ user_name }}, +{% trans %}Dear {{ user_name }},{% endtrans %} +{% trans -%} You have been invited to {{ site_title }}. A user has already been created for you with the username {{ user_name }}. You can change it later. @@ -9,9 +10,11 @@ You have been added to the {{ group_type }} {{ group_title }} with the following To accept this invite, please reset your password at: {{ reset_link }} +{%- endtrans %} - -Have a nice day. +{% trans %}Have a nice day.{% endtrans %} -- +{% trans -%} Message sent by {{ site_title }} ({{ site_url }}) +{%- endtrans %} diff --git a/ckan/templates/emails/invite_user_subject.txt b/ckan/templates/emails/invite_user_subject.txt index 6aa3184abf6..c4d43449e0b 100644 --- a/ckan/templates/emails/invite_user_subject.txt +++ b/ckan/templates/emails/invite_user_subject.txt @@ -1 +1 @@ -Invite for {{ site_title }} +{% trans site_title=site_title %}Invite for {{ site_title }}{% endtrans %} diff --git a/ckan/templates/emails/reset_password.txt b/ckan/templates/emails/reset_password.txt index 803913e2ad6..4f2ffabc33a 100644 --- a/ckan/templates/emails/reset_password.txt +++ b/ckan/templates/emails/reset_password.txt @@ -1,12 +1,16 @@ -Dear {{ user_name }}, +{% trans %}Dear {{ user_name }},{% endtrans %} +{% trans -%} You have requested your password on {{ site_title }} to be reset. Please click the following link to confirm this request: {{ reset_link }} +{%- endtrans %} -Have a nice day. +{% trans %}Have a nice day.{% endtrans %} -- +{% trans -%} Message sent by {{ site_title }} ({{ site_url }}) +{%- endtrans %} diff --git a/ckan/templates/emails/reset_password_subject.txt b/ckan/templates/emails/reset_password_subject.txt index 828b8dc7c93..e938c6680a4 100644 --- a/ckan/templates/emails/reset_password_subject.txt +++ b/ckan/templates/emails/reset_password_subject.txt @@ -1 +1 @@ -Reset your password - {{ site_title }} +{{ _('Reset your password') }} - {{ site_title }}