mirror of https://github.com/zulip/zulip.git
private-messages: Update translated backend strings use "direct message".
Updates user-facing translated strings containing "private message" on the backend to use "direct message" instead.
This commit is contained in:
parent
d098e8275d
commit
a0fd7b2afc
|
@ -179,20 +179,20 @@ class TestGetChartData(ZulipTestCase):
|
||||||
"everyone": {
|
"everyone": {
|
||||||
"Public streams": self.data(100),
|
"Public streams": self.data(100),
|
||||||
"Private streams": self.data(0),
|
"Private streams": self.data(0),
|
||||||
"Private messages": self.data(101),
|
"Direct messages": self.data(101),
|
||||||
"Group private messages": self.data(0),
|
"Group direct messages": self.data(0),
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"Public streams": self.data(200),
|
"Public streams": self.data(200),
|
||||||
"Private streams": self.data(201),
|
"Private streams": self.data(201),
|
||||||
"Private messages": self.data(0),
|
"Direct messages": self.data(0),
|
||||||
"Group private messages": self.data(0),
|
"Group direct messages": self.data(0),
|
||||||
},
|
},
|
||||||
"display_order": [
|
"display_order": [
|
||||||
"Private messages",
|
"Direct messages",
|
||||||
"Public streams",
|
"Public streams",
|
||||||
"Private streams",
|
"Private streams",
|
||||||
"Group private messages",
|
"Group direct messages",
|
||||||
],
|
],
|
||||||
"result": "success",
|
"result": "success",
|
||||||
},
|
},
|
||||||
|
@ -287,8 +287,8 @@ class TestGetChartData(ZulipTestCase):
|
||||||
{
|
{
|
||||||
"Public streams": [0],
|
"Public streams": [0],
|
||||||
"Private streams": [0],
|
"Private streams": [0],
|
||||||
"Private messages": [0],
|
"Direct messages": [0],
|
||||||
"Group private messages": [0],
|
"Group direct messages": [0],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -296,8 +296,8 @@ class TestGetChartData(ZulipTestCase):
|
||||||
{
|
{
|
||||||
"Public streams": [0],
|
"Public streams": [0],
|
||||||
"Private streams": [0],
|
"Private streams": [0],
|
||||||
"Private messages": [0],
|
"Direct messages": [0],
|
||||||
"Group private messages": [0],
|
"Group direct messages": [0],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -293,8 +293,8 @@ def get_chart_data(
|
||||||
stats[0]: {
|
stats[0]: {
|
||||||
"public_stream": _("Public streams"),
|
"public_stream": _("Public streams"),
|
||||||
"private_stream": _("Private streams"),
|
"private_stream": _("Private streams"),
|
||||||
"private_message": _("Private messages"),
|
"private_message": _("Direct messages"),
|
||||||
"huddle_message": _("Group private messages"),
|
"huddle_message": _("Group direct messages"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
labels_sort_function = lambda data: sort_by_totals(data["everyone"])
|
labels_sort_function = lambda data: sort_by_totals(data["everyone"])
|
||||||
|
|
|
@ -85,9 +85,9 @@ def validate_message_edit_payload(
|
||||||
|
|
||||||
if not message.is_stream_message():
|
if not message.is_stream_message():
|
||||||
if stream_id is not None:
|
if stream_id is not None:
|
||||||
raise JsonableError(_("Private messages cannot be moved to streams."))
|
raise JsonableError(_("Direct messages cannot be moved to streams."))
|
||||||
if topic_name is not None:
|
if topic_name is not None:
|
||||||
raise JsonableError(_("Private messages cannot have topics."))
|
raise JsonableError(_("Direct messages cannot have topics."))
|
||||||
|
|
||||||
if propagate_mode != "change_one" and topic_name is None and stream_id is None:
|
if propagate_mode != "change_one" and topic_name is None and stream_id is None:
|
||||||
raise JsonableError(_("Invalid propagate_mode without topic edit"))
|
raise JsonableError(_("Invalid propagate_mode without topic edit"))
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ def check_private_message_policy(
|
||||||
# notifications from system bots to users.
|
# notifications from system bots to users.
|
||||||
return
|
return
|
||||||
|
|
||||||
raise JsonableError(_("Private messages are disabled in this organization."))
|
raise JsonableError(_("Direct messages are disabled in this organization."))
|
||||||
|
|
||||||
|
|
||||||
# check_message:
|
# check_message:
|
||||||
|
|
|
@ -70,7 +70,7 @@ def send_initial_pms(user: UserProfile) -> None:
|
||||||
content = "".join(
|
content = "".join(
|
||||||
[
|
[
|
||||||
welcome_msg + " ",
|
welcome_msg + " ",
|
||||||
_("This is a private message from me, Welcome Bot.") + "\n\n",
|
_("This is a direct message from me, Welcome Bot.") + "\n\n",
|
||||||
_(
|
_(
|
||||||
"If you are new to Zulip, check out our [Getting started guide]({getting_started_url})!"
|
"If you are new to Zulip, check out our [Getting started guide]({getting_started_url})!"
|
||||||
),
|
),
|
||||||
|
@ -160,7 +160,7 @@ def select_welcome_bot_response(human_response_lower: str) -> str:
|
||||||
+ "\n\n",
|
+ "\n\n",
|
||||||
_(
|
_(
|
||||||
"Check out [Recent conversations](#recent) to see what's happening! "
|
"Check out [Recent conversations](#recent) to see what's happening! "
|
||||||
'You can return to this conversation by clicking "Private messages" in the upper left.'
|
'You can return to this conversation by clicking "Direct messages" in the upper left.'
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
@ -74,7 +74,7 @@ def validate_recipient_user_profiles(
|
||||||
realms.add(user_profile.realm_id)
|
realms.add(user_profile.realm_id)
|
||||||
|
|
||||||
if len(realms) > 1:
|
if len(realms) > 1:
|
||||||
raise ValidationError(_("You can't send private messages outside of your organization."))
|
raise ValidationError(_("You can't send direct messages outside of your organization."))
|
||||||
|
|
||||||
return list(recipient_profiles_map.values())
|
return list(recipient_profiles_map.values())
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ class EditMessagePayloadTest(EditMessageTestCase):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assert_json_error(result, "Private messages cannot be moved to streams.")
|
self.assert_json_error(result, "Direct messages cannot be moved to streams.")
|
||||||
|
|
||||||
def test_private_message_edit_topic(self) -> None:
|
def test_private_message_edit_topic(self) -> None:
|
||||||
hamlet = self.example_user("hamlet")
|
hamlet = self.example_user("hamlet")
|
||||||
|
@ -167,7 +167,7 @@ class EditMessagePayloadTest(EditMessageTestCase):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assert_json_error(result, "Private messages cannot have topics.")
|
self.assert_json_error(result, "Direct messages cannot have topics.")
|
||||||
|
|
||||||
def test_propagate_invalid(self) -> None:
|
def test_propagate_invalid(self) -> None:
|
||||||
self.login("hamlet")
|
self.login("hamlet")
|
||||||
|
|
|
@ -2351,7 +2351,7 @@ class InternalPrepTest(ZulipTestCase):
|
||||||
m.output[0].split("\n")[0],
|
m.output[0].split("\n")[0],
|
||||||
"ERROR:root:Error queueing internal message by {}: {}".format(
|
"ERROR:root:Error queueing internal message by {}: {}".format(
|
||||||
"cordelia@zulip.com",
|
"cordelia@zulip.com",
|
||||||
"You can't send private messages outside of your organization.",
|
"You can't send direct messages outside of your organization.",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ class TutorialTests(ZulipTestCase):
|
||||||
"In Zulip, topics [tell you what a message is about](/help/streams-and-topics). "
|
"In Zulip, topics [tell you what a message is about](/help/streams-and-topics). "
|
||||||
"They are light-weight subjects, very similar to the subject line of an email.\n\n"
|
"They are light-weight subjects, very similar to the subject line of an email.\n\n"
|
||||||
"Check out [Recent conversations](#recent) to see what's happening! "
|
"Check out [Recent conversations](#recent) to see what's happening! "
|
||||||
'You can return to this conversation by clicking "Private messages" in the upper left.'
|
'You can return to this conversation by clicking "Direct messages" in the upper left.'
|
||||||
)
|
)
|
||||||
self.assertEqual(most_recent_message(user).content, expected_response)
|
self.assertEqual(most_recent_message(user).content, expected_response)
|
||||||
|
|
||||||
|
|
|
@ -448,9 +448,7 @@ class TestSendTypingNotificationsSettings(ZulipTestCase):
|
||||||
with self.tornado_redirected_to_list(events, expected_num_events=0):
|
with self.tornado_redirected_to_list(events, expected_num_events=0):
|
||||||
result = self.api_post(sender, "/api/v1/typing", params)
|
result = self.api_post(sender, "/api/v1/typing", params)
|
||||||
|
|
||||||
self.assert_json_error(
|
self.assert_json_error(result, "User has disabled typing notifications for direct messages")
|
||||||
result, "User has disabled typing notifications for private messages"
|
|
||||||
)
|
|
||||||
self.assertEqual(events, [])
|
self.assertEqual(events, [])
|
||||||
|
|
||||||
def test_send_stream_typing_notifications_setting(self) -> None:
|
def test_send_stream_typing_notifications_setting(self) -> None:
|
||||||
|
|
|
@ -49,7 +49,7 @@ def send_notification_backend(
|
||||||
do_send_stream_typing_notification(user_profile, operator, stream, topic)
|
do_send_stream_typing_notification(user_profile, operator, stream, topic)
|
||||||
else:
|
else:
|
||||||
if not user_profile.send_private_typing_notifications:
|
if not user_profile.send_private_typing_notifications:
|
||||||
raise JsonableError(_("User has disabled typing notifications for private messages"))
|
raise JsonableError(_("User has disabled typing notifications for direct messages"))
|
||||||
|
|
||||||
user_ids = notification_to
|
user_ids = notification_to
|
||||||
check_send_typing_notification(user_profile, user_ids, operator)
|
check_send_typing_notification(user_profile, user_ids, operator)
|
||||||
|
|
Loading…
Reference in New Issue