mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
18n: Cleanup strings to be translated in send_pm_if_empty_stream.
This commit is contained in:
@@ -2205,26 +2205,27 @@ def send_pm_if_empty_stream(stream: Optional[Stream],
|
|||||||
return
|
return
|
||||||
|
|
||||||
arg_dict = {
|
arg_dict = {
|
||||||
"bot_identity": sender.delivery_email,
|
"bot_identity": f"`{sender.delivery_email}`",
|
||||||
"stream_id": stream_id,
|
"stream_id": stream_id,
|
||||||
"stream_name": stream_name,
|
"stream_name": f"#**{stream_name}**",
|
||||||
|
"new_stream_link": "#streams/new",
|
||||||
}
|
}
|
||||||
if sender.bot_owner is not None:
|
if sender.bot_owner is not None:
|
||||||
with override_language(sender.bot_owner.default_language):
|
with override_language(sender.bot_owner.default_language):
|
||||||
if stream is None:
|
if stream is None:
|
||||||
if stream_id is not None:
|
if stream_id is not None:
|
||||||
content = _("Your bot `{bot_identity}` tried to send a message to stream ID "
|
content = _("Your bot {bot_identity} tried to send a message to stream ID "
|
||||||
"{stream_id}, but there is no stream with that ID.").format(**arg_dict)
|
"{stream_id}, but there is no stream with that ID.").format(**arg_dict)
|
||||||
else:
|
else:
|
||||||
assert(stream_name is not None)
|
assert(stream_name is not None)
|
||||||
content = _("Your bot `{bot_identity}` tried to send a message to stream "
|
content = _("Your bot {bot_identity} tried to send a message to stream "
|
||||||
"#**{stream_name}**, but that stream does not exist. "
|
"{stream_name}, but that stream does not exist. "
|
||||||
"Click [here](#streams/new) to create it.").format(**arg_dict)
|
"Click [here]({new_stream_link}) to create it.").format(**arg_dict)
|
||||||
else:
|
else:
|
||||||
if num_subscribers_for_stream_id(stream.id) > 0:
|
if num_subscribers_for_stream_id(stream.id) > 0:
|
||||||
return
|
return
|
||||||
content = _("Your bot `{bot_identity}` tried to send a message to "
|
content = _("Your bot {bot_identity} tried to send a message to "
|
||||||
"stream #**{stream_name}**. The stream exists but "
|
"stream {stream_name}. The stream exists but "
|
||||||
"does not have any subscribers.").format(**arg_dict)
|
"does not have any subscribers.").format(**arg_dict)
|
||||||
|
|
||||||
send_rate_limited_pm_notification_to_bot_owner(sender, realm, content)
|
send_rate_limited_pm_notification_to_bot_owner(sender, realm, content)
|
||||||
|
|||||||
Reference in New Issue
Block a user