diff --git a/CHANGELOG.txt b/CHANGELOG.txt index daf1773dc2..d6b4bc6198 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -37,6 +37,7 @@ Changelog * Add support for embedding Instagram reels (Luis Nell) * Use Django’s JavaScript catalog feature to manage translatable strings in JavaScript (Karl Hobley) * Add a `page_description` to the Page model, to provide help text for a given page type (Kalob Taulien, Thibaud Colas, Matt Westcott) + * Add `trimmed` attribute to all blocktrans tags, so spacing is more reliable in translated strings (Harris Lapiroff) * Fix: When using `simple_translations` ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy) * Fix: When previewing unsaved changes to `Form` pages, ensure that all added fields are correctly shown in the preview (Joshua Munn) * Fix: When Documents (e.g. PDFs) have been configured to be served inline via `WAGTAILDOCS_CONTENT_TYPES` & `WAGTAILDOCS_INLINE_CONTENT_TYPES` ensure that the filename is correctly set in the `Content-Disposition` header so that saving the files will use the correct filename (John-Scott Atlakson) diff --git a/docs/extending/custom_bulk_actions.rst b/docs/extending/custom_bulk_actions.rst index eaddc20186..adfe9eec09 100644 --- a/docs/extending/custom_bulk_actions.rst +++ b/docs/extending/custom_bulk_actions.rst @@ -48,7 +48,7 @@ An example for a confirmation template is as follows: {% extends 'wagtailadmin/bulk_actions/confirmation/base.html' %} {% load i18n wagtailadmin_tags %} - {% block titletag %}{% blocktrans count counter=items|length %}Delete 1 item{% plural %}Delete {{ counter }} items{% endblocktrans %}{% endblock %} + {% block titletag %}{% blocktrans trimmed count counter=items|length %}Delete 1 item{% plural %}Delete {{ counter }} items{% endblocktrans %}{% endblock %} {% block header %} {% trans "Delete" as del_str %} @@ -70,7 +70,7 @@ An example for a confirmation template is as follows: {% block items_with_no_access %} - {% blocktrans asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to delete this item{% plural %}You don't have permission to delete these items{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to delete this item{% plural %}You don't have permission to delete these items{% endblocktrans %} {% include './list_items_with_no_access.html' with items=items_with_no_access no_access_msg=no_access_msg %} {% endblock items_with_no_access %} diff --git a/docs/releases/3.0.md b/docs/releases/3.0.md index 2c1856a1a3..17acd19771 100644 --- a/docs/releases/3.0.md +++ b/docs/releases/3.0.md @@ -67,7 +67,7 @@ class LandingPage(Page): * Split up linting / formatting tasks in Makefile into client and server components (Hitansh Shah) * Add support for embedding Instagram reels (Luis Nell) * Use Django’s JavaScript catalog feature to manage translatable strings in JavaScript (Karl Hobley) - + * Add `trimmed` attribute to all blocktrans tags, so spacing is more reliable in translated strings (Harris Lapiroff) ### Bug fixes diff --git a/wagtail/admin/templates/wagtailadmin/chooser/_search_results.html b/wagtail/admin/templates/wagtailadmin/chooser/_search_results.html index bf2bc9b2c2..3ed2b99ad3 100644 --- a/wagtail/admin/templates/wagtailadmin/chooser/_search_results.html +++ b/wagtail/admin/templates/wagtailadmin/chooser/_search_results.html @@ -1,7 +1,7 @@ {% load i18n wagtailadmin_tags %}
{% icon name='warning' %} - {% blocktrans with type=page_type_names|join:", " count counter=page_type_names|length %} + {% blocktrans trimmed with type=page_type_names|join:", " count counter=page_type_names|length %} Only pages of type "{{ type }}" may be chosen for this field. Search results will exclude pages of other types. {% plural %} Only the following page types may be chosen for this field: {{ type }}. Search results will exclude pages of other types. diff --git a/wagtail/admin/templates/wagtailadmin/chooser/confirm_external_to_internal.html b/wagtail/admin/templates/wagtailadmin/chooser/confirm_external_to_internal.html index 05f855f401..3d682f6fbb 100644 --- a/wagtail/admin/templates/wagtailadmin/chooser/confirm_external_to_internal.html +++ b/wagtail/admin/templates/wagtailadmin/chooser/confirm_external_to_internal.html @@ -4,14 +4,14 @@
- {% blocktrans %} + {% blocktrans trimmed %} The URL you entered, {{ submitted_url }}, looks like it matches the internal page {{ page }}, which has the URL {{ internal_url }}. {% endblocktrans %}
- {% blocktrans %} + {% blocktrans trimmed %} Converting this to an internal link to {{ page }} would make the link more robust. Would you like to do this? {% endblocktrans %} diff --git a/wagtail/admin/templates/wagtailadmin/collections/index.html b/wagtail/admin/templates/wagtailadmin/collections/index.html index 646e77a0e7..953484c87f 100644 --- a/wagtail/admin/templates/wagtailadmin/collections/index.html +++ b/wagtail/admin/templates/wagtailadmin/collections/index.html @@ -29,7 +29,7 @@ {% else %} {% url 'wagtailadmin_collections:add' as add_collection_url %} -
{% blocktrans %}No collections have been created. Why not add one?{% endblocktrans %}
+{% blocktrans trimmed %}No collections have been created. Why not add one?{% endblocktrans %}
{% endif %}- {% blocktrans count counter=page.descendant_count %} + {% blocktrans trimmed count counter=page.descendant_count %} This will also delete one more subpage. {% plural %} This will also delete {{ counter }} more subpages. @@ -32,7 +32,7 @@ {% block items_with_no_access %} - {% blocktrans asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to delete this page{% plural %}You don't have permission to delete these pages{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to delete this page{% plural %}You don't have permission to delete these pages{% endblocktrans %} {% include './list_items_with_no_access.html' with items=items_with_no_access no_access_msg=no_access_msg %} {% endblock items_with_no_access %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html b/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html index 0168d8163d..b807e7a0d4 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html +++ b/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html @@ -1,7 +1,7 @@ {% extends 'wagtailadmin/bulk_actions/confirmation/base.html' %} {% load i18n %} -{% block titletag %}{% blocktrans count counter=items|length %}Move 1 page{% plural %}Move {{ counter }} pages{% endblocktrans %} +{% block titletag %}{% blocktrans trimmed count counter=items|length %}Move 1 page{% plural %}Move {{ counter }} pages{% endblocktrans %} {% endblock %} {% block header %} @@ -18,7 +18,7 @@ {{ page.item.get_admin_display_title }} {% if not page.item.is_leaf %}
- {% blocktrans count counter=page.child_pages %} + {% blocktrans trimmed count counter=page.child_pages %} This page has one child page {% plural %} This page has {{ counter }} child pages @@ -33,13 +33,13 @@ {% block items_with_no_access %} - {% blocktrans asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to move this page{% plural %}You don't have permission to move these pages{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to move this page{% plural %}You don't have permission to move these pages{% endblocktrans %} {% include './list_items_with_no_access.html' with items=items_with_no_access no_access_msg=no_access_msg %} - {% blocktrans asvar no_access_msg with dest_title=destination.title count counter=items_with_no_access|length %}The following page cannot be moved to {{dest_title}} {% plural %}The following pages cannot be moved to {{dest_title}}{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg with dest_title=destination.title count counter=items_with_no_access|length %}The following page cannot be moved to {{dest_title}} {% plural %}The following pages cannot be moved to {{dest_title}}{% endblocktrans %} {% include './list_items_with_no_access.html' with items=pages_without_destination_access no_access_msg=no_access_msg %} - {% blocktrans asvar no_access_msg count counter=pages_with_duplicate_slugs|length %}The following page cannot be moved due to duplicate slug{% plural %}The following pages cannot be moved due to duplicate slugs{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg count counter=pages_with_duplicate_slugs|length %}The following page cannot be moved due to duplicate slug{% plural %}The following pages cannot be moved due to duplicate slugs{% endblocktrans %} {% include './list_items_with_no_access.html' with items=pages_with_duplicate_slugs no_access_msg=no_access_msg %} {% trans "There is no valid destination page for these pages" as no_access_msg %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_publish.html b/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_publish.html index a13584f8d0..7eeedc2e54 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_publish.html +++ b/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_publish.html @@ -1,7 +1,7 @@ {% extends 'wagtailadmin/bulk_actions/confirmation/base.html' %} {% load i18n %} -{% block titletag %}{% blocktrans count counter=items|length %}Publish 1 page {% plural %}Publish {{ counter }} pages{% endblocktrans %}{% endblock %} +{% block titletag %}{% blocktrans trimmed count counter=items|length %}Publish 1 page {% plural %}Publish {{ counter }} pages{% endblocktrans %}{% endblock %} {% block header %} {% trans "Publish" as publish_str %} @@ -17,7 +17,7 @@ {{ page.item.get_admin_display_title }} {% if page.draft_descendant_count %}
- {% blocktrans count counter=page.draft_descendant_count %} + {% blocktrans trimmed count counter=page.draft_descendant_count %} This page has one unpublished subpage {% plural %} This page has {{ counter }} unpublished subpages @@ -32,7 +32,7 @@ {% block items_with_no_access %} - {% blocktrans asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to publish this page{% plural %}You don't have permission to publish these pages{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to publish this page{% plural %}You don't have permission to publish these pages{% endblocktrans %} {% include './list_items_with_no_access.html' with items=items_with_no_access no_access_msg=no_access_msg %} {% endblock items_with_no_access %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_unpublish.html b/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_unpublish.html index e445eb058a..10d60666ee 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_unpublish.html +++ b/wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_unpublish.html @@ -1,7 +1,7 @@ {% extends 'wagtailadmin/bulk_actions/confirmation/base.html' %} {% load i18n %} -{% block titletag %}{% blocktrans count counter=items|length %}Unpublish 1 page {% plural %}Unpublish {{ counter }} pages{% endblocktrans %}{% endblock %} +{% block titletag %}{% blocktrans trimmed count counter=items|length %}Unpublish 1 page {% plural %}Unpublish {{ counter }} pages{% endblocktrans %}{% endblock %} {% block header %} {% trans "Unpublish" as unpublish_str %} @@ -17,7 +17,7 @@ {{ page.item.get_admin_display_title }}
{% if page.live_descendant_count %} - {% blocktrans count counter=page.live_descendant_count %} + {% blocktrans trimmed count counter=page.live_descendant_count %} This page has one subpage {% plural %} This page has {{ counter }} subpages @@ -32,7 +32,7 @@ {% block items_with_no_access %} - {% blocktrans asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to unpublish this page{% plural %}You don't have permission to unpublish these pages{% endblocktrans %} + {% blocktrans trimmed asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to unpublish this page{% plural %}You don't have permission to unpublish these pages{% endblocktrans %} {% include './list_items_with_no_access.html' with items=items_with_no_access no_access_msg=no_access_msg %} {% endblock items_with_no_access %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/confirm_convert_alias.html b/wagtail/admin/templates/wagtailadmin/pages/confirm_convert_alias.html index 8e93411538..4ff7a0e63e 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/confirm_convert_alias.html +++ b/wagtail/admin/templates/wagtailadmin/pages/confirm_convert_alias.html @@ -1,6 +1,6 @@ {% extends "wagtailadmin/base.html" %} {% load i18n wagtailadmin_tags %} -{% block titletag %}{% blocktrans with title=page.get_admin_display_title %}Convert alias {{ title }}{% endblocktrans %}{% endblock %} +{% block titletag %}{% blocktrans trimmed with title=page.get_admin_display_title %}Convert alias {{ title }}{% endblocktrans %}{% endblock %} {% block content %} {% trans "Convert alias" as del_str %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/confirm_delete.html b/wagtail/admin/templates/wagtailadmin/pages/confirm_delete.html index 1c5748fbc4..c5c3911728 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/confirm_delete.html +++ b/wagtail/admin/templates/wagtailadmin/pages/confirm_delete.html @@ -1,6 +1,6 @@ {% extends "wagtailadmin/base.html" %} {% load i18n wagtailadmin_tags %} -{% block titletag %}{% blocktrans with title=page.get_admin_display_title %}Delete {{ title }}{% endblocktrans %}{% endblock %} +{% block titletag %}{% blocktrans trimmed with title=page.get_admin_display_title %}Delete {{ title }}{% endblocktrans %}{% endblock %} {% block content %} {% trans "Delete" as del_str %} @@ -10,7 +10,7 @@
{% trans 'Are you sure you want to delete this page?' %} {% if descendant_count %} - {% blocktrans count counter=descendant_count %} + {% blocktrans trimmed count counter=descendant_count %} This will also delete one more subpage. {% plural %} This will also delete {{ descendant_count }} more subpages. @@ -28,7 +28,7 @@ {% page_permissions page as page_perms %} {% if page_perms.can_unpublish %} {% url 'wagtailadmin_pages:unpublish' page.id as unpublish_url %} -
{% blocktrans %}Alternatively you can unpublish the page. This removes the page from public view and you can edit or publish it again later.{% endblocktrans %}
+{% blocktrans trimmed %}Alternatively you can unpublish the page. This removes the page from public view and you can edit or publish it again later.{% endblocktrans %}
{% endif %} {% endblock %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/confirm_move.html b/wagtail/admin/templates/wagtailadmin/pages/confirm_move.html index 114bb98d7a..f1d9529466 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/confirm_move.html +++ b/wagtail/admin/templates/wagtailadmin/pages/confirm_move.html @@ -1,15 +1,15 @@ {% extends "wagtailadmin/base.html" %} {% load i18n %} -{% block titletag %}{% blocktrans with title=page_to_move.get_admin_display_title %}Move {{ title }}{% endblocktrans %}{% endblock %} +{% block titletag %}{% blocktrans trimmed with title=page_to_move.get_admin_display_title %}Move {{ title }}{% endblocktrans %}{% endblock %} {% block content %} {% trans "Move" as move_str %} {% include "wagtailadmin/shared/header.html" with title=move_str subtitle=page_to_move.get_admin_display_title icon="doc-empty-inverse" %}{% blocktrans with title=destination.get_admin_display_title %}Are you sure you want to move this page into '{{ title }}'?{% endblocktrans %}
+{% blocktrans trimmed with title=destination.get_admin_display_title %}Are you sure you want to move this page into '{{ title }}'?{% endblocktrans %}
{% else %} -{% blocktrans with title=destination.get_admin_display_title %}Are you sure you want to move this page and all of its children into '{{ title }}'?{% endblocktrans %}
+{% blocktrans trimmed with title=destination.get_admin_display_title %}Are you sure you want to move this page and all of its children into '{{ title }}'?{% endblocktrans %}
{% endif %}