Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
i18n: Mark notification bot message in notify_new_user for translation.
Vishnu KSce6203906fd7
diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.pyindex 881eb2d482d..76d7238e804 100644--- a/tools/lib/capitalization.py+++ b/tools/lib/capitalization.py@@ -86,6 +86,7 @@ IGNORED_PHRASES = [r"zulip_org_id",r"admins",r"members",+ r"signups",# Placeholdersr"keyword",r"streamname",diff --git a/zerver/lib/actions.py b/zerver/lib/actions.pyindex 1a71c92fad3..c3507bdebc8 100644--- a/zerver/lib/actions.py+++ b/zerver/lib/actions.py@@ -33,6 +33,7 @@ from django.db.models import Count, Exists, F, Max, OuterRef, Q, Sumfrom django.db.models.query import QuerySetfrom django.utils.html import escapefrom django.utils.timezone import now as timezone_now+from django.utils.translation import override as override_languagefrom django.utils.translation import ugettext as _from psycopg2.extras import execute_valuesfrom psycopg2.sql import SQL@@ -341,26 +342,37 @@ def notify_new_user(user_profile: UserProfile) -> None:# Send notification to realm signup notifications stream if it exists# Don't send notification for the first user in a realmif signup_notifications_stream is not None and user_count > 1:- internal_send_stream_message(- user_profile.realm,- sender,- signup_notifications_stream,- "signups",- f"@_**{user_profile.full_name}|{user_profile.id}** just signed up for Zulip. (total: {user_count})",- )+ with override_language(user_profile.realm.default_language):+ message = _("{user} just signed up for Zulip. (total: {user_count})").format(+ user=f"@_**{user_profile.full_name}|{user_profile.id}**",+ user_count=user_count+ )+ internal_send_stream_message(+ user_profile.realm,+ sender,+ signup_notifications_stream,+ _("signups"),+ message+ )# We also send a notification to the Zulip administrative realmadmin_realm = sender.realmtry:# Check whether the stream existssignups_stream = get_signups_stream(admin_realm)- internal_send_stream_message(- admin_realm,- sender,- signups_stream,- user_profile.realm.display_subdomain,- f"{user_profile.full_name} <`{user_profile.email}`> just signed up for Zulip! (total: **{user_count}**)",- )+ with override_language(admin_realm.default_language):+ # We intentionally use the same strings as above to avoid translation burden.+ message = _("{user} just signed up for Zulip. (total: {user_count})").format(+ user=f"{user_profile.full_name} <`{user_profile.email}`>",+ user_count=user_count+ )+ internal_send_stream_message(+ admin_realm,+ sender,+ signups_stream,+ user_profile.realm.display_subdomain,+ message+ )except Stream.DoesNotExist:# If the signups stream hasn't been created in the admin