From bff44ae4150f6f8c40959e3f2b1409be0020fa2e Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Thu, 13 Jul 2023 17:30:26 +0200 Subject: [PATCH] Avoid HTML markup in translation strings --- ihatemoney/templates/history.html | 17 ++++++++--------- ihatemoney/templates/send_invites.html | 2 +- ihatemoney/tests/history_test.py | 8 ++++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ihatemoney/templates/history.html b/ihatemoney/templates/history.html index 21788517..7ce45750 100644 --- a/ihatemoney/templates/history.html +++ b/ihatemoney/templates/history.html @@ -103,18 +103,17 @@ {% if current_log_pref == LoggingMode.DISABLED or (current_log_pref != LoggingMode.RECORD_IP and any_ip_addresses) %}
{% if current_log_pref == LoggingMode.DISABLED %} -

{% set url = url_for(".edit_project") %} - {% trans %} - This project has history disabled. New actions won't appear below. You can enable history on the - settings page - {% endtrans %} +

+ {{ _("This project has history disabled. New actions won't appear below.") }} + {{ _("You can enable history on the settings page.") }} +

{% if history %}

- {% trans %} - The table below reflects actions recorded prior to disabling project history. You can - clear project history to remove them.

- {% endtrans %} + {{ _("The table below reflects actions recorded prior to disabling project history.") }} + {{ _("You can clear the project history to remove them.") }} + +

{% endif %} {% endif %} {% if current_log_pref != LoggingMode.RECORD_IP and any_ip_addresses %} diff --git a/ihatemoney/templates/send_invites.html b/ihatemoney/templates/send_invites.html index 7983d61f..cf6797b7 100644 --- a/ihatemoney/templates/send_invites.html +++ b/ihatemoney/templates/send_invites.html @@ -29,7 +29,7 @@

{{ _('Scan QR code') }}

-

{% trans download_mobile=url_for(".mobile") %}On a mobile device, with a compatible app installed.{% endtrans %}

+

{{ _("Use a mobile device with a compatible app.") }}

{{ qrcode | safe }} diff --git a/ihatemoney/tests/history_test.py b/ihatemoney/tests/history_test.py index e9856fe1..1cc15ced 100644 --- a/ihatemoney/tests/history_test.py +++ b/ihatemoney/tests/history_test.py @@ -55,7 +55,7 @@ class HistoryTestCase(IhatemoneyTestCase): def assert_empty_history_logging_disabled(self): resp = self.client.get("/demo/history") self.assertIn( - "This project has history disabled. New actions won't appear below. ", + "This project has history disabled. New actions won't appear below.", resp.data.decode("utf-8"), ) self.assertIn("Nothing to list", resp.data.decode("utf-8")) @@ -248,7 +248,7 @@ class HistoryTestCase(IhatemoneyTestCase): resp = self.client.get("/demo/history") self.assertEqual(resp.status_code, 200) self.assertIn( - "This project has history disabled. New actions won't appear below. ", + "This project has history disabled. New actions won't appear below.", resp.data.decode("utf-8"), ) self.assertIn( @@ -287,7 +287,7 @@ class HistoryTestCase(IhatemoneyTestCase): resp = self.client.get("/demo/history") self.assertEqual(resp.status_code, 200) self.assertNotIn( - "This project has history disabled. New actions won't appear below. ", + "This project has history disabled. New actions won't appear below.", resp.data.decode("utf-8"), ) self.assertNotIn( @@ -332,7 +332,7 @@ class HistoryTestCase(IhatemoneyTestCase): self.assertEqual(resp.status_code, 200) self.assertNotIn( - "This project has history disabled. New actions won't appear below. ", + "This project has history disabled. New actions won't appear below.", resp.data.decode("utf-8"), ) self.assertNotIn(