diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 8fccff3d1d..4d66625ad9 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -3564,10 +3564,13 @@ def do_rename_stream(stream: Stream, stream.realm, sender, stream, - "welcome", - "@_**%s|%d** renamed stream **%s** to **%s**" % (user_profile.full_name, - user_profile.id, - old_name, new_name) + _('stream events'), + _('@_**%(user_name)s|%(user_id)d** renamed stream **%(old_stream_name)s** to ' + '**%(new_stream_name)s**.') % { + 'user_name': user_profile.full_name, + 'user_id': user_profile.id, + 'old_stream_name': old_name, + 'new_stream_name': new_name} ) # Even though the token doesn't change, the web client needs to update the # email forwarding address to display the correctly-escaped new name. diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 77c385bd9d..e718504898 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -2360,7 +2360,7 @@ class EventsRegisterTest(ZulipTestCase): stream = self.make_stream('old_name') new_name = u'stream with a brand new name' self.subscribe(self.user_profile, stream.name) - notification = '

King Hamlet renamed stream old_name to stream with a brand new name

' + notification = '

King Hamlet renamed stream old_name to stream with a brand new name.

' action = lambda: do_rename_stream(stream, new_name, self.user_profile) events = self.do_test(action, num_events=3) schema_checker = self.check_events_dict([ @@ -2405,7 +2405,7 @@ class EventsRegisterTest(ZulipTestCase): ('avatar_url', check_url), ('reactions', check_list(None)), ('client', equals('Internal')), - (TOPIC_NAME, equals('welcome')), + (TOPIC_NAME, equals('stream events')), ('recipient_id', check_int) ])), ('id', check_int) diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py index 95fb6c5a3b..e4274a0648 100644 --- a/zerver/tests/test_subs.py +++ b/zerver/tests/test_subs.py @@ -603,7 +603,7 @@ class StreamAdminTest(ZulipTestCase): # Inspect the notification message sent message = self.get_last_message() actual_stream = Stream.objects.get(id=message.recipient.type_id) - message_content = '@_**King Hamlet|{}** renamed stream **stream_name1** to **stream_name2**'.format(user_profile.id) + message_content = '@_**King Hamlet|{}** renamed stream **stream_name1** to **stream_name2**.'.format(user_profile.id) self.assertEqual(message.sender.realm, user_profile.realm) self.assertEqual(actual_stream.name, 'stream_name2') self.assertEqual(message.recipient.type, Recipient.STREAM) diff --git a/zerver/views/streams.py b/zerver/views/streams.py index 7d5ba2025e..f388a5ae17 100644 --- a/zerver/views/streams.py +++ b/zerver/views/streams.py @@ -426,8 +426,9 @@ def add_subscriptions_backend( sender=sender, stream=stream, topic=_('stream events'), - content=_('Stream created by @_**%s|%d**.') % ( - user_profile.full_name, user_profile.id) + content=_('Stream created by @_**%(user_name)s|%(user_id)d**.') % { + 'user_name': user_profile.full_name, + 'user_id': user_profile.id} ) )