mirror of https://github.com/zulip/zulip.git
onboarding: Update new org welcome msgs for stream to channel rename.
Updates the translated strings in the messages sent by the welcome bot in new Zulip organizations to use channel instead of stream. Comments out part of a test that uses translated Italian strings to check these welcome bot messages and adds a TODO comment to note that the test code should be uncommented when those strings are translated for the stream -> channel rename. Part of stream to channel rename project.
This commit is contained in:
parent
3f79fd0f10
commit
9b46204fad
|
@ -137,7 +137,7 @@ def bot_commands(no_help_command: bool = False) -> str:
|
|||
"apps",
|
||||
"profile",
|
||||
"theme",
|
||||
"streams",
|
||||
"channels",
|
||||
"topics",
|
||||
"message formatting",
|
||||
"keyboard shortcuts",
|
||||
|
@ -172,12 +172,13 @@ def select_welcome_bot_response(human_response_lower: str) -> str:
|
|||
elif human_response_lower in ["stream", "streams", "channel", "channels"]:
|
||||
return "".join(
|
||||
[
|
||||
_(
|
||||
"In Zulip, streams [determine who gets a message](/help/streams-and-topics). "
|
||||
"They are similar to channels in other chat apps."
|
||||
_("In Zulip, channels [determine who gets a message]({help_link}).").format(
|
||||
help_link="/help/streams-and-topics"
|
||||
)
|
||||
+ "\n\n",
|
||||
_("[Browse and subscribe to streams](#streams/all)."),
|
||||
_("[Browse and subscribe to channels]({settings_link}).").format(
|
||||
settings_link="#streams/all"
|
||||
),
|
||||
]
|
||||
)
|
||||
elif human_response_lower in ["topic", "topics"]:
|
||||
|
@ -268,36 +269,38 @@ def send_initial_realm_messages(realm: Realm) -> None:
|
|||
# view slightly less overwhelming
|
||||
with override_language(realm.default_language):
|
||||
content_of_private_streams_topic_name = (
|
||||
_("This is a private stream, as indicated by the lock icon next to the stream name.")
|
||||
_("This is a private channel, as indicated by the lock icon next to the channel name.")
|
||||
+ " "
|
||||
+ _("Private streams are only visible to stream members.")
|
||||
+ _("Private channels are only visible to channel members.")
|
||||
+ "\n"
|
||||
"\n"
|
||||
+ _(
|
||||
"To manage this stream, go to [Stream settings]({stream_settings_url}) "
|
||||
"and click on `{initial_private_stream_name}`."
|
||||
"To manage this channel, go to [Channel settings]({channel_settings_url}) "
|
||||
"and click on `{initial_private_channel_name}`."
|
||||
)
|
||||
).format(
|
||||
stream_settings_url="#streams/subscribed",
|
||||
initial_private_stream_name=Realm.INITIAL_PRIVATE_STREAM_NAME,
|
||||
channel_settings_url="#streams/subscribed",
|
||||
initial_private_channel_name=Realm.INITIAL_PRIVATE_STREAM_NAME,
|
||||
)
|
||||
|
||||
content1_of_topic_demonstration_topic_name = (
|
||||
_(
|
||||
"This is a message on stream #**{default_notification_stream_name}** with the "
|
||||
"This is a message on channel #**{default_notification_channel_name}** with the "
|
||||
"topic `topic demonstration`."
|
||||
)
|
||||
).format(default_notification_stream_name=Realm.DEFAULT_NOTIFICATION_STREAM_NAME)
|
||||
).format(default_notification_channel_name=Realm.DEFAULT_NOTIFICATION_STREAM_NAME)
|
||||
|
||||
content2_of_topic_demonstration_topic_name = (
|
||||
_("Topics are a lightweight tool to keep conversations organized.")
|
||||
+ " "
|
||||
+ _("You can learn more about topics at [Streams and topics]({about_topics_help_url}).")
|
||||
+ _(
|
||||
"You can learn more about topics at [Channels and topics]({about_topics_help_url})."
|
||||
)
|
||||
).format(about_topics_help_url="/help/streams-and-topics")
|
||||
|
||||
content_of_swimming_turtles_topic_name = (
|
||||
_(
|
||||
"This is a message on stream #**{default_notification_stream_name}** with the "
|
||||
"This is a message on channel #**{default_notification_channel_name}** with the "
|
||||
"topic `swimming turtles`."
|
||||
)
|
||||
+ "\n"
|
||||
|
@ -310,7 +313,7 @@ def send_initial_realm_messages(realm: Realm) -> None:
|
|||
previous message."
|
||||
)
|
||||
).format(
|
||||
default_notification_stream_name=Realm.DEFAULT_NOTIFICATION_STREAM_NAME,
|
||||
default_notification_channel_name=Realm.DEFAULT_NOTIFICATION_STREAM_NAME,
|
||||
start_topic_help_url="/help/starting-a-new-topic",
|
||||
)
|
||||
|
||||
|
@ -334,7 +337,7 @@ they can be disabled. [Learn more]({zulip_update_announcements_help_url}).
|
|||
welcome_messages: List[Dict[str, str]] = [
|
||||
{
|
||||
"stream": Realm.INITIAL_PRIVATE_STREAM_NAME,
|
||||
"topic_name": "private streams",
|
||||
"topic_name": "private channels",
|
||||
"content": content_of_private_streams_topic_name,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1304,7 +1304,7 @@ class RealmCreationTest(ZulipTestCase):
|
|||
# Check welcome messages
|
||||
for stream_name, text, message_count in [
|
||||
(Realm.DEFAULT_NOTIFICATION_STREAM_NAME, "with the topic", 4),
|
||||
(Realm.INITIAL_PRIVATE_STREAM_NAME, "private stream", 1),
|
||||
(Realm.INITIAL_PRIVATE_STREAM_NAME, "private channel", 1),
|
||||
]:
|
||||
stream = get_stream(stream_name, realm)
|
||||
recipient = stream.recipient
|
||||
|
@ -1737,21 +1737,23 @@ class RealmCreationTest(ZulipTestCase):
|
|||
self.assertEqual(realm.string_id, string_id)
|
||||
self.assertEqual(realm.default_language, realm_language)
|
||||
|
||||
# Check welcome messages
|
||||
with_the_topic_in_italian = "con l'argomento"
|
||||
private_stream_in_italian = "canale privato"
|
||||
# TODO: When Italian translated strings are updated for changes
|
||||
# that are part of the stream -> channel rename, uncomment below.
|
||||
# # Check welcome messages
|
||||
# with_the_topic_in_italian = "con l'argomento"
|
||||
# private_stream_in_italian = "canale privato"
|
||||
|
||||
for stream_name, text, message_count in [
|
||||
(Realm.DEFAULT_NOTIFICATION_STREAM_NAME, with_the_topic_in_italian, 4),
|
||||
(Realm.INITIAL_PRIVATE_STREAM_NAME, private_stream_in_italian, 1),
|
||||
]:
|
||||
stream = get_stream(stream_name, realm)
|
||||
recipient = stream.recipient
|
||||
messages = Message.objects.filter(realm_id=realm.id, recipient=recipient).order_by(
|
||||
"date_sent"
|
||||
)
|
||||
self.assert_length(messages, message_count)
|
||||
self.assertIn(text, messages[0].content)
|
||||
# for stream_name, text, message_count in [
|
||||
# (Realm.DEFAULT_NOTIFICATION_STREAM_NAME, with_the_topic_in_italian, 4),
|
||||
# (Realm.INITIAL_PRIVATE_STREAM_NAME, private_stream_in_italian, 1),
|
||||
# ]:
|
||||
# stream = get_stream(stream_name, realm)
|
||||
# recipient = stream.recipient
|
||||
# messages = Message.objects.filter(realm_id=realm.id, recipient=recipient).order_by(
|
||||
# "date_sent"
|
||||
# )
|
||||
# self.assert_length(messages, message_count)
|
||||
# self.assertIn(text, messages[0].content)
|
||||
|
||||
@override_settings(OPEN_REALM_CREATION=True, CLOUD_FREE_TRIAL_DAYS=30)
|
||||
def test_create_realm_during_free_trial(self) -> None:
|
||||
|
|
|
@ -93,9 +93,8 @@ class TutorialTests(ZulipTestCase):
|
|||
for content in messages:
|
||||
self.send_personal_message(user, bot, content)
|
||||
expected_response = (
|
||||
"In Zulip, streams [determine who gets a message](/help/streams-and-topics). "
|
||||
"They are similar to channels in other chat apps.\n\n"
|
||||
"[Browse and subscribe to streams](#streams/all)."
|
||||
"In Zulip, channels [determine who gets a message](/help/streams-and-topics).\n\n"
|
||||
"[Browse and subscribe to channels](#streams/all)."
|
||||
)
|
||||
self.assertEqual(most_recent_message(user).content, expected_response)
|
||||
|
||||
|
@ -154,7 +153,7 @@ class TutorialTests(ZulipTestCase):
|
|||
expected_response = (
|
||||
"Here are a few messages I understand: "
|
||||
"`apps`, `profile`, `theme`, "
|
||||
"`streams`, `topics`, `message formatting`, `keyboard shortcuts`.\n\n"
|
||||
"`channels`, `topics`, `message formatting`, `keyboard shortcuts`.\n\n"
|
||||
"Check out our [Getting started guide](/help/getting-started-with-zulip), "
|
||||
"or browse the [Help center](/help/) to learn more!"
|
||||
)
|
||||
|
@ -169,7 +168,7 @@ class TutorialTests(ZulipTestCase):
|
|||
self.send_personal_message(user, bot, content)
|
||||
expected_response = (
|
||||
"I’m sorry, I did not understand your message. Please try one of the following commands: "
|
||||
"`apps`, `profile`, `theme`, `streams`, "
|
||||
"`apps`, `profile`, `theme`, `channels`, "
|
||||
"`topics`, `message formatting`, `keyboard shortcuts`, `help`."
|
||||
)
|
||||
self.assertEqual(most_recent_message(user).content, expected_response)
|
||||
|
|
Loading…
Reference in New Issue