stats: Update translated strings for stream to channel rename.

Updates the labels for the "Messages sent by recipient type" chart
to use "channel", and updates the error message that would be sent
for the "messages_sent_by_stream" chart (that has not yet been
implemented) for a missing channel/stream.

Part of the stream to channel rename project.
This commit is contained in:
Lauryn Menard 2024-04-16 13:33:22 +02:00 committed by Tim Abbott
parent abc6f5b8a2
commit d0a62020ff
2 changed files with 13 additions and 13 deletions

View File

@ -192,21 +192,21 @@ class TestGetChartData(ZulipTestCase):
"end_times": [datetime_to_timestamp(dt) for dt in self.end_times_day],
"frequency": CountStat.DAY,
"everyone": {
"Public streams": self.data(100),
"Private streams": self.data(0),
"Public channels": self.data(100),
"Private channels": self.data(0),
"Direct messages": self.data(101),
"Group direct messages": self.data(0),
},
"user": {
"Public streams": self.data(200),
"Private streams": self.data(201),
"Public channels": self.data(200),
"Private channels": self.data(201),
"Direct messages": self.data(0),
"Group direct messages": self.data(0),
},
"display_order": [
"Direct messages",
"Public streams",
"Private streams",
"Public channels",
"Private channels",
"Group direct messages",
],
"result": "success",
@ -343,8 +343,8 @@ class TestGetChartData(ZulipTestCase):
self.assertEqual(
data["everyone"],
{
"Public streams": [0],
"Private streams": [0],
"Public channels": [0],
"Private channels": [0],
"Direct messages": [0],
"Group direct messages": [0],
},
@ -352,8 +352,8 @@ class TestGetChartData(ZulipTestCase):
self.assertEqual(
data["user"],
{
"Public streams": [0],
"Private streams": [0],
"Public channels": [0],
"Private channels": [0],
"Direct messages": [0],
"Group direct messages": [0],
},

View File

@ -310,8 +310,8 @@ def get_chart_data(
tables = (aggregate_table, UserCount)
subgroup_to_label = {
stats[0]: {
"public_stream": _("Public streams"),
"private_stream": _("Private streams"),
"public_stream": _("Public channels"),
"private_stream": _("Private channels"),
"private_message": _("Direct messages"),
"huddle_message": _("Group direct messages"),
}
@ -336,7 +336,7 @@ def get_chart_data(
elif chart_name == "messages_sent_by_stream":
if stream is None:
raise JsonableError(
_("Missing stream for chart: {chart_name}").format(chart_name=chart_name)
_("Missing channel for chart: {chart_name}").format(chart_name=chart_name)
)
stats = [COUNT_STATS["messages_in_stream:is_bot:day"]]
tables = (aggregate_table, StreamCount)