exceptions: Update translated errors for stream to channel rename.

In zerver/lib/exceptions.py, updates translated error strings
to use channel instead of stream.

Note that the STREAM_WILDCARD_MENTION_NOT_ALLOWED and the
STREAM_DOES_NOT_EXIST error codes, and any additional fields
included with those errors, are not changed in these updates.

Part of stream to channel rename project.
This commit is contained in:
Lauryn Menard
2024-04-16 21:27:36 +02:00
committed by Tim Abbott
parent 51b3ef8ee3
commit 0b5f325e48
4 changed files with 13 additions and 13 deletions

View File

@@ -174,7 +174,7 @@ class StreamDoesNotExistError(JsonableError):
@staticmethod
@override
def msg_format() -> str:
return _("Stream '{stream}' does not exist")
return _("Channel '{stream}' does not exist")
class StreamWithIDDoesNotExistError(JsonableError):
@@ -187,7 +187,7 @@ class StreamWithIDDoesNotExistError(JsonableError):
@staticmethod
@override
def msg_format() -> str:
return _("Stream with ID '{stream_id}' does not exist")
return _("Channel with ID '{stream_id}' does not exist")
class CannotDeactivateLastUserError(JsonableError):
@@ -631,7 +631,7 @@ class StreamWildcardMentionNotAllowedError(JsonableError):
@staticmethod
@override
def msg_format() -> str:
return _("You do not have permission to use stream wildcard mentions in this stream.")
return _("You do not have permission to use channel wildcard mentions in this channel.")
class TopicWildcardMentionNotAllowedError(JsonableError):

View File

@@ -6653,7 +6653,7 @@ paths:
- example:
{
"result": "error",
"msg": "You do not have permission to use stream wildcard mentions in this stream.",
"msg": "You do not have permission to use channel wildcard mentions in this channel.",
"code": "STREAM_WILDCARD_MENTION_NOT_ALLOWED",
}
description: |
@@ -8010,7 +8010,7 @@ paths:
- example:
{
"result": "error",
"msg": "You do not have permission to use stream wildcard mentions in this stream.",
"msg": "You do not have permission to use channel wildcard mentions in this channel.",
"code": "STREAM_WILDCARD_MENTION_NOT_ALLOWED",
}
description: |
@@ -21300,9 +21300,9 @@ components:
example:
{
"code": "STREAM_DOES_NOT_EXIST",
"msg": "Stream 'nonexistent_stream' does not exist",
"msg": "Channel 'nonexistent' does not exist",
"result": "error",
"stream": "nonexistent_stream",
"stream": "nonexistent",
}
NonExistingStreamIdError:
allOf:
@@ -21319,7 +21319,7 @@ components:
example:
{
"code": "STREAM_DOES_NOT_EXIST",
"msg": "Stream with ID '9' does not exist",
"msg": "Channel with ID '9' does not exist",
"result": "error",
"stream_id": 9,
}

View File

@@ -1423,7 +1423,7 @@ class EditMessageTest(ZulipTestCase):
},
)
self.assert_json_error(
result, "You do not have permission to use stream wildcard mentions in this stream."
result, "You do not have permission to use channel wildcard mentions in this channel."
)
with mock.patch("zerver.lib.message.num_subscribers_for_stream_id", return_value=14):

View File

@@ -135,7 +135,7 @@ class MessagePOSTTest(ZulipTestCase):
"topic": "Test topic for stream ID message",
},
)
self.assert_json_error(result, "Stream with ID '99999' does not exist")
self.assert_json_error(result, "Channel with ID '99999' does not exist")
msg = self.get_last_message()
expected = (
@@ -558,7 +558,7 @@ class MessagePOSTTest(ZulipTestCase):
"topic": "Test topic",
},
)
self.assert_json_error(result, "Stream 'nonexistent_stream' does not exist")
self.assert_json_error(result, "Channel 'nonexistent_stream' does not exist")
def test_message_to_nonexistent_stream_with_bad_characters(self) -> None:
"""
@@ -576,7 +576,7 @@ class MessagePOSTTest(ZulipTestCase):
},
)
self.assert_json_error(
result, "Stream '&<"'><non-existent>' does not exist"
result, "Channel '&<"'><non-existent>' does not exist"
)
def test_message_to_stream_with_automatically_change_visibility_policy(self) -> None:
@@ -1961,7 +1961,7 @@ class StreamMessagesTest(ZulipTestCase):
else:
with self.assertRaisesRegex(
JsonableError,
"You do not have permission to use stream wildcard mentions in this stream.",
"You do not have permission to use channel wildcard mentions in this channel.",
):
self.send_stream_message(sender, "test_stream", content)