From 6434bc9c5434508cc4ab6da1d8f1711a2284a997 Mon Sep 17 00:00:00 2001 From: Christoph Meissner Date: Fri, 1 Apr 2022 11:42:43 +0200 Subject: [PATCH 1/9] Adapt templates to `translate` and `blocktranslate` Changed in Django 3.1: The `trans` tag was renamed to `translate` and `blocktrans` was renamed to `blocktranslate` and Raider is now known as Twix. fixes #540 --- accounts/templates/shift_list.html | 28 ++-- accounts/templates/shift_list_done.html | 8 +- accounts/templates/user_account_delete.html | 16 +-- accounts/templates/user_account_edit.html | 2 +- accounts/templates/user_detail.html | 12 +- accounts/templates/user_detail_deleted.html | 2 +- .../additional_flat_page_style_inline.html | 6 +- content/templates/flatpages/default.html | 2 +- non_logged_in_area/templates/404.html | 4 +- non_logged_in_area/templates/500.html | 8 +- .../templates/base_non_logged_in.html | 18 +-- non_logged_in_area/templates/home.html | 28 ++-- .../templates/privacy_policy.html | 130 +++++++++--------- .../templates/shelters_need_help.html | 38 ++--- .../templates/emails/membership_approved.txt | 12 +- organizations/templates/facility.html | 8 +- organizations/templates/manage_members.html | 22 +-- organizations/templates/organization.html | 4 +- .../templates/partials/compact_facility.html | 4 +- scheduler/templates/geographic_helpdesk.html | 10 +- scheduler/templates/helpdesk.html | 14 +- scheduler/templates/helpdesk_breadcrumps.html | 2 +- scheduler/templates/helpdesk_single.html | 52 +++---- .../shift_cancellation_notification.html | 4 +- scheduler/templates/shift_details.html | 14 +- .../shift_modification_notification.html | 4 +- .../scheduletemplates/apply_template.html | 30 ++-- .../apply_template_confirm.html | 26 ++-- .../scheduletemplate_submit_line.html | 10 +- .../shifttemplate/shift_template_inline.html | 10 +- templates/partials/faq_link.html | 2 +- templates/partials/footer.html | 16 +-- templates/partials/management_tools.html | 4 +- templates/partials/navigation_bar.html | 12 +- templates/partials/region_selection.html | 2 +- templates/registration/activate.html | 14 +- .../registration/activation_complete.html | 6 +- templates/registration/activation_email.html | 4 +- templates/registration/activation_email.txt | 4 +- .../registration/activation_email_subject.txt | 2 +- .../admin_approve_complete_email.html | 4 +- .../admin_approve_complete_email.txt | 2 +- templates/registration/login.html | 12 +- .../registration/password_change_done.html | 4 +- .../registration/password_change_form.html | 10 +- .../registration/password_reset_complete.html | 8 +- .../registration/password_reset_confirm.html | 6 +- .../registration/password_reset_done.html | 6 +- .../registration/password_reset_email.html | 8 +- .../registration/password_reset_form.html | 12 +- .../registration/registration_complete.html | 10 +- templates/registration/registration_form.html | 24 ++-- 52 files changed, 350 insertions(+), 350 deletions(-) diff --git a/accounts/templates/shift_list.html b/accounts/templates/shift_list.html index 3b6dd2b3..ef2e0bc4 100644 --- a/accounts/templates/shift_list.html +++ b/accounts/templates/shift_list.html @@ -9,60 +9,60 @@ - {% trans 'Show my work shifts in the past' %} + {% translate 'Show my work shifts in the past' %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/accounts/templates/shift_list_done.html b/accounts/templates/shift_list_done.html index 0063f5d7..ffe0d191 100644 --- a/accounts/templates/shift_list_done.html +++ b/accounts/templates/shift_list_done.html @@ -9,15 +9,15 @@ - {% trans 'Show my work shifts in the future' %} + {% translate 'Show my work shifts in the future' %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/accounts/templates/user_account_delete.html b/accounts/templates/user_account_delete.html index 8ebd7757..fe62d3f3 100644 --- a/accounts/templates/user_account_delete.html +++ b/accounts/templates/user_account_delete.html @@ -7,15 +7,15 @@ {% block content %}
- {% trans 'If you delete your account, this information will be anonymized, and its not possible for you to log into Volunteer-Planner anymore.' %} - {% trans 'Its not possible to recover this information. If you want to work as volunteer again, you will have to create a new account.' %} + {% translate 'If you delete your account, this information will be anonymized, and its not possible for you to log into Volunteer-Planner anymore.' %} + {% translate 'Its not possible to recover this information. If you want to work as volunteer again, you will have to create a new account.' %}
- {% trans 'Delete Account (no additional warning)' %} + {% translate 'Delete Account (no additional warning)' %}
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/accounts/templates/user_account_edit.html b/accounts/templates/user_account_edit.html index 767e9aed..5017a96d 100644 --- a/accounts/templates/user_account_edit.html +++ b/accounts/templates/user_account_edit.html @@ -9,7 +9,7 @@
{% csrf_token %} {{ form.as_p }} - +
{% endblock %} diff --git a/accounts/templates/user_detail.html b/accounts/templates/user_detail.html index 8aaf5439..53aa119f 100644 --- a/accounts/templates/user_detail.html +++ b/accounts/templates/user_detail.html @@ -7,14 +7,14 @@ {% block content %}
- {% trans 'Edit Account' %} - {% trans 'Delete Account' %} + {% translate 'Edit Account' %} + {% translate 'Delete Account' %}
{% endblock %} diff --git a/accounts/templates/user_detail_deleted.html b/accounts/templates/user_detail_deleted.html index 1db55b36..91d1f136 100644 --- a/accounts/templates/user_detail_deleted.html +++ b/accounts/templates/user_detail_deleted.html @@ -3,6 +3,6 @@ {% block content %}
- {% trans 'Your user account has been deleted.' %} + {% translate 'Your user account has been deleted.' %}
{% endblock %} diff --git a/content/templates/flatpages/additional_flat_page_style_inline.html b/content/templates/flatpages/additional_flat_page_style_inline.html index 9e961b82..ffa5fa14 100644 --- a/content/templates/flatpages/additional_flat_page_style_inline.html +++ b/content/templates/flatpages/additional_flat_page_style_inline.html @@ -9,7 +9,7 @@

{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

id="{{ inline_admin_formset.formset.prefix }}- {% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}"> {% if inline_admin_form.show_url %} - {% trans "View on site" %}{% endif %} + {% translate "View on site" %}{% endif %} {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %} {{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}{% endif %} @@ -29,8 +29,8 @@

{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

$("#{{ inline_admin_formset.formset.prefix }}-group .inline-related").stackedFormset({ prefix: '{{ inline_admin_formset.formset.prefix }}', adminStaticPrefix: '{% static "admin/" %}', - deleteText: "{% trans "Remove" %}", - addText: "{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|capfirst %}Add another {{ verbose_name }}{% endblocktrans %}" + deleteText: "{% translate "Remove" %}", + addText: "{% blocktranslate with verbose_name=inline_admin_formset.opts.verbose_name|capfirst %}Add another {{ verbose_name }}{% endblocktranslate %}" }); })(django.jQuery); diff --git a/content/templates/flatpages/default.html b/content/templates/flatpages/default.html index 9e4091d4..f41673f3 100644 --- a/content/templates/flatpages/default.html +++ b/content/templates/flatpages/default.html @@ -20,7 +20,7 @@ {% if perms.flatpages.can_change_page %}
- {% trans "Edit this page" %} + {% translate "Edit this page" %} {% endif %} {% endblock %} diff --git a/non_logged_in_area/templates/404.html b/non_logged_in_area/templates/404.html index c6bb55c3..4d539a84 100644 --- a/non_logged_in_area/templates/404.html +++ b/non_logged_in_area/templates/404.html @@ -5,9 +5,9 @@ {% block content %}
-

{% trans "Page not found" %}

+

{% translate "Page not found" %}

{{ request_path }}
-

{% trans "We're sorry, but the requested page could not be found." %}

+

{% translate "We're sorry, but the requested page could not be found." %}

{% endblock %} diff --git a/non_logged_in_area/templates/500.html b/non_logged_in_area/templates/500.html index d5f37595..33c14971 100644 --- a/non_logged_in_area/templates/500.html +++ b/non_logged_in_area/templates/500.html @@ -1,15 +1,15 @@ {% extends "base_non_logged_in.html" %} {% load i18n %} -{% block title %} Volunteer Planner - {% trans "server error" as server_error_title %}{{ server_error_title|title }}{% endblock %} +{% block title %} Volunteer Planner - {% translate "server error" as server_error_title %}{{ server_error_title|title }}{% endblock %} {% block content %}
-

{% trans "Server Error (500)" %}

+

{% translate "Server Error (500)" %}

- {% blocktrans trimmed %} + {% blocktranslate trimmed %} There's been an error. It should be fixed shortly. Thanks for your patience. - {% endblocktrans %} + {% endblocktranslate %}

diff --git a/non_logged_in_area/templates/base_non_logged_in.html b/non_logged_in_area/templates/base_non_logged_in.html index 007be6c6..e0061a6d 100644 --- a/non_logged_in_area/templates/base_non_logged_in.html +++ b/non_logged_in_area/templates/base_non_logged_in.html @@ -54,10 +54,10 @@ {% include "partials/switch_language.html" with nav_item_tag="span" %} - {% trans "Login" %} + {% translate "Login" %} - {% trans "Start helping" %} + {% translate "Start helping" %} @@ -84,25 +84,25 @@