Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

i18n: Mark notification bot message in queue_processors for translation.

Vishnu KS0a36f04c204e
diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py
index 83f8a431415..a19d14ba2e4 100644
--- a/zerver/worker/queue_processors.py
+++ b/zerver/worker/queue_processors.py
@@ -36,6 +36,8 @@ import ujson
from django.conf import settings
from django.db import connection
from django.utils.timezone import now as timezone_now
+from django.utils.translation import override as override_language
+from django.utils.translation import ugettext as _
from zulip_bots.lib import ExternalBotHandler, extract_query_without_mention
from zerver.context_processors import common_context
@@ -734,7 +736,8 @@ class DeferredWorker(QueueProcessingWorker):
# Send a private message notification letting the user who
# triggered the export know the export finished.
- content = f"Your data export is complete and has been uploaded here:\n\n{public_url}"
+ with override_language(user_profile.default_language):
+ content = _("Your data export is complete and has been uploaded here:\n\n{public_url}").format(public_url=public_url)
internal_send_private_message(
realm=user_profile.realm,
sender=get_system_bot(settings.NOTIFICATION_BOT),