Clarify overwrite dialog message and remove reference to model name

Change 'session' to 'window' and remove mention of model name to avoid
issues with gendered languages
pull/12195/head
Sage Abdullah 2024-07-25 14:46:32 +01:00 zatwierdzone przez Thibaud Colas
rodzic b7dacf52ea
commit 9dea339727
2 zmienionych plików z 17 dodań i 20 usunięć

Wyświetl plik

@ -18,7 +18,7 @@
{% if current_session.user == session.user %}
{% blocktranslate trimmed asvar saved_new_version_message %}
You saved a new version in another session
You saved a new version in another window
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=session.user|user_display_name|default:_("System") asvar saved_new_version_message %}
@ -47,7 +47,7 @@
{% elif session.is_editing %}
{% if current_session.user == session.user %}
{% blocktranslate trimmed asvar has_unsaved_changes_message %}
You have unsaved changes in another session
You have unsaved changes in another window
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=session.user|user_display_name|default:_("System") asvar has_unsaved_changes_message %}
@ -106,12 +106,12 @@
{% if sessions.0.revision_id %}
<template data-controller="w-teleport" data-w-teleport-target-value="#title-text-w-overwrite-changes-dialog" data-w-teleport-reset-value="true">
{% if current_session.user == sessions.0.user %}
{% blocktranslate trimmed with model_name=_("page") asvar someone_has_saved_message %}
You have saved a newer version of this {{ model_name }} in another session
{% blocktranslate trimmed asvar someone_has_saved_message %}
You saved a new version in another window
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") model_name=_("page") asvar someone_has_saved_message %}
{{ user_name }} has saved a newer version of this {{ model_name }}
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") asvar someone_has_saved_message %}
{{ user_name }} saved a new version
{% endblocktranslate %}
{% endif %}
{{ someone_has_saved_message }}
@ -120,11 +120,11 @@
<template data-controller="w-teleport" data-w-teleport-target-value="#subtitle-w-overwrite-changes-dialog" data-w-teleport-reset-value="true">
{% if current_session.user == sessions.0.user %}
{% blocktranslate trimmed asvar overwrite_message %}
Proceeding will overwrite the changes you made in that session. Refreshing the page will lose any of your unsaved changes in the current session.
Proceeding will overwrite the changes you made in that window. Refreshing the page will show you the new changes, but you will lose any of your unsaved changes in the current window.
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") asvar overwrite_message %}
Proceeding will overwrite the changes made by {{ user_name }}. Refreshing the page will lose any of your unsaved changes.
Proceeding will overwrite the changes made by {{ user_name }}. Refreshing the page will show you the new changes, but you will lose any of your unsaved changes.
{% endblocktranslate %}
{% endif %}
{{ overwrite_message }}

Wyświetl plik

@ -285,17 +285,14 @@ class TestPingView(WagtailTestUtils, TestCase):
'template[data-w-teleport-target-value="#title-text-w-overwrite-changes-dialog"]'
)
self.assertIsNotNone(dialog_title)
self.assertIn(
"Vic Otheruser has saved a newer version of this page",
dialog_title.string,
)
self.assertIn("Vic Otheruser saved a new version", dialog_title.string)
dialog_subtitle = soup.select_one(
'template[data-w-teleport-target-value="#subtitle-w-overwrite-changes-dialog"]'
)
self.assertIsNotNone(dialog_subtitle)
self.assertIn(
"Proceeding will overwrite the changes made by Vic Otheruser. "
"Refreshing the page will lose any of your unsaved changes.",
"Refreshing the page will show you the new changes, but you will lose any of your unsaved changes.",
dialog_subtitle.string,
)
@ -342,7 +339,7 @@ class TestPingView(WagtailTestUtils, TestCase):
)
self.assertIsNotNone(dialog_title)
self.assertIn(
"Vic Otheruser has saved a newer version of this page",
"Vic Otheruser saved a new version",
dialog_title.string,
)
dialog_subtitle = soup.select_one(
@ -351,7 +348,7 @@ class TestPingView(WagtailTestUtils, TestCase):
self.assertIsNotNone(dialog_subtitle)
self.assertIn(
"Proceeding will overwrite the changes made by Vic Otheruser. "
"Refreshing the page will lose any of your unsaved changes.",
"Refreshing the page will show you the new changes, but you will lose any of your unsaved changes.",
dialog_subtitle.string,
)
@ -424,7 +421,7 @@ class TestPingView(WagtailTestUtils, TestCase):
)
self.assertIsNotNone(dialog_title)
self.assertIn(
"Gordon Thirduser has saved a newer version of this page",
"Gordon Thirduser saved a new version",
dialog_title.string,
)
dialog_subtitle = soup.select_one(
@ -433,7 +430,7 @@ class TestPingView(WagtailTestUtils, TestCase):
self.assertIsNotNone(dialog_subtitle)
self.assertIn(
"Proceeding will overwrite the changes made by Gordon Thirduser. "
"Refreshing the page will lose any of your unsaved changes.",
"Refreshing the page will show you the new changes, but you will lose any of your unsaved changes.",
dialog_subtitle.string,
)
other_session_text = rendered_sessions[1].text
@ -494,7 +491,7 @@ class TestPingView(WagtailTestUtils, TestCase):
)
self.assertIsNotNone(dialog_title)
self.assertIn(
"System has saved a newer version of this page",
"System saved a new version",
dialog_title.string,
)
dialog_subtitle = soup.select_one(
@ -503,7 +500,7 @@ class TestPingView(WagtailTestUtils, TestCase):
self.assertIsNotNone(dialog_subtitle)
self.assertIn(
"Proceeding will overwrite the changes made by System. "
"Refreshing the page will lose any of your unsaved changes.",
"Refreshing the page will show you the new changes, but you will lose any of your unsaved changes.",
dialog_subtitle.string,
)
other_session_text = rendered_sessions[1].text
@ -730,7 +727,7 @@ class TestPingView(WagtailTestUtils, TestCase):
rendered_sessions = soup.select("ol.w-editing-sessions__list li")
self.assertEqual(len(rendered_sessions), 2)
session_text = rendered_sessions[0].text
self.assertIn("You have unsaved changes in another session", session_text)
self.assertIn("You have unsaved changes in another window", session_text)
self.assertNotIn("Currently viewing", session_text)
dialog_title = soup.select_one(
'template[data-w-teleport-target-value="#title-text-w-overwrite-changes-dialog"]'